Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #700 from hainesc/master
Browse files Browse the repository at this point in the history
Add support for arm32
  • Loading branch information
starnop authored Jul 22, 2019
2 parents ae9e9a3 + 89c7518 commit 3720413
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions common/util/stat_linux_arm.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright The Dragonfly Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package util

import (
"syscall"
"time"
)

// Atime returns the last access time in time.Time.
func Atime(stat *syscall.Stat_t) time.Time {
return time.Unix(int64(stat.Atim.Sec), int64(stat.Atim.Nsec))
}

// AtimeSec returns the last access time in seconds.
func AtimeSec(stat *syscall.Stat_t) int64 {
return int64(stat.Atim.Sec)
}

// Ctime returns the create time in time.Time.
func Ctime(stat *syscall.Stat_t) time.Time {
return time.Unix(int64(stat.Ctim.Sec), int64(stat.Ctim.Nsec))
}

// CtimeSec returns the create time in seconds.
func CtimeSec(stat *syscall.Stat_t) int64 {
return int64(stat.Ctim.Sec)
}

0 comments on commit 3720413

Please sign in to comment.