Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions unix/linux/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,34 @@ typedef struct {

long st_blocks;
} my_stat;
#elif defined(__sparc__) && defined(__arch64__)

// The glibc and kernel stat do not agree on sparc64 either: glibc puts st_ino
// at offset 16 and st_nlink at 28, the kernel at 8 and 16. The raw syscalls
// fill the kernel's struct stat64, so use that, with the same adjustments as
// above.
typedef struct {
unsigned long st_dev;
unsigned long st_ino;
unsigned long st_nlink;

unsigned int st_mode;
unsigned int st_uid;
unsigned int st_gid;
unsigned int __pad0;

unsigned long st_rdev;
long st_size;
long st_blksize;
long st_blocks;

// Declared as six separate longs in the kernel.
struct timespec st_atim;
struct timespec st_mtim;
struct timespec st_ctim;

long __unused[3];
} my_stat;
#else
typedef struct stat my_stat;
#endif
Expand Down
6 changes: 3 additions & 3 deletions unix/syscall_linux_sparc64.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package unix

//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
//sys Fchown(fd int, uid int, gid int) (err error)
//sys Fstat(fd int, stat *Stat_t) (err error)
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
//sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64
//sys Fstatfs(fd int, buf *Statfs_t) (err error)
//sys Ftruncate(fd int, length int64) (err error)
Expand All @@ -19,7 +19,7 @@ package unix
//sysnb Getuid() (uid int)
//sys Lchown(path string, uid int, gid int) (err error)
//sys Listen(s int, n int) (err error)
//sys Lstat(path string, stat *Stat_t) (err error)
//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
//sys Pause() (err error)
//sys pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64
//sys pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64
Expand All @@ -31,7 +31,7 @@ package unix
//sys setfsuid(uid int) (prev int, err error)
//sys Shutdown(fd int, how int) (err error)
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
//sys Stat(path string, stat *Stat_t) (err error)
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
//sys Statfs(path string, buf *Statfs_t) (err error)
//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
//sys Truncate(path string, length int64) (err error)
Expand Down
6 changes: 3 additions & 3 deletions unix/zsyscall_linux_sparc64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions unix/ztypes_linux_sparc64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.