linux_stats.c (957d68dd91a6dd07f056c5bbd81ce1e257248748) linux_stats.c (510ea843baf66ae678ca6ddbbbca9816177be5b0)
1/*-
2 * Copyright (c) 1994-1995 S�ren Schmidt
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 159 unchanged lines hidden (view full) ---

168 tbuf.st_dev = minor(buf->st_dev) | (major(buf->st_dev) << 8);
169 tbuf.st_ino = buf->st_ino;
170 tbuf.st_mode = buf->st_mode;
171 tbuf.st_nlink = buf->st_nlink;
172 tbuf.st_uid = buf->st_uid;
173 tbuf.st_gid = buf->st_gid;
174 tbuf.st_rdev = buf->st_rdev;
175 tbuf.st_size = buf->st_size;
1/*-
2 * Copyright (c) 1994-1995 S�ren Schmidt
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 159 unchanged lines hidden (view full) ---

168 tbuf.st_dev = minor(buf->st_dev) | (major(buf->st_dev) << 8);
169 tbuf.st_ino = buf->st_ino;
170 tbuf.st_mode = buf->st_mode;
171 tbuf.st_nlink = buf->st_nlink;
172 tbuf.st_uid = buf->st_uid;
173 tbuf.st_gid = buf->st_gid;
174 tbuf.st_rdev = buf->st_rdev;
175 tbuf.st_size = buf->st_size;
176 tbuf.st_atime = buf->st_atime;
177 tbuf.st_mtime = buf->st_mtime;
178 tbuf.st_ctime = buf->st_ctime;
176 tbuf.st_atim.tv_sec = buf->st_atim.tv_sec;
177 tbuf.st_atim.tv_nsec = buf->st_atim.tv_nsec;
178 tbuf.st_mtim.tv_sec = buf->st_mtim.tv_sec;
179 tbuf.st_mtim.tv_nsec = buf->st_mtim.tv_nsec;
180 tbuf.st_ctim.tv_sec = buf->st_ctim.tv_sec;
181 tbuf.st_ctim.tv_nsec = buf->st_ctim.tv_nsec;
179 tbuf.st_blksize = buf->st_blksize;
180 tbuf.st_blocks = buf->st_blocks;
181
182 return (copyout(&tbuf, ubuf, sizeof(tbuf)));
183}
184
185int
186linux_newstat(struct thread *td, struct linux_newstat_args *args)

--- 68 unchanged lines hidden (view full) ---

255 lbuf.st_nlink = buf->st_nlink;
256 lbuf.st_uid = buf->st_uid;
257 lbuf.st_gid = buf->st_gid;
258 lbuf.st_rdev = buf->st_rdev;
259 if (buf->st_size < (quad_t)1 << 32)
260 lbuf.st_size = buf->st_size;
261 else
262 lbuf.st_size = -2;
182 tbuf.st_blksize = buf->st_blksize;
183 tbuf.st_blocks = buf->st_blocks;
184
185 return (copyout(&tbuf, ubuf, sizeof(tbuf)));
186}
187
188int
189linux_newstat(struct thread *td, struct linux_newstat_args *args)

--- 68 unchanged lines hidden (view full) ---

258 lbuf.st_nlink = buf->st_nlink;
259 lbuf.st_uid = buf->st_uid;
260 lbuf.st_gid = buf->st_gid;
261 lbuf.st_rdev = buf->st_rdev;
262 if (buf->st_size < (quad_t)1 << 32)
263 lbuf.st_size = buf->st_size;
264 else
265 lbuf.st_size = -2;
263 lbuf.st_atime = buf->st_atime;
264 lbuf.st_mtime = buf->st_mtime;
265 lbuf.st_ctime = buf->st_ctime;
266 lbuf.st_atim.tv_sec = buf->st_atim.tv_sec;
267 lbuf.st_atim.tv_nsec = buf->st_atim.tv_nsec;
268 lbuf.st_mtim.tv_sec = buf->st_mtim.tv_sec;
269 lbuf.st_mtim.tv_nsec = buf->st_mtim.tv_nsec;
270 lbuf.st_ctim.tv_sec = buf->st_ctim.tv_sec;
271 lbuf.st_ctim.tv_nsec = buf->st_ctim.tv_nsec;
266 lbuf.st_blksize = buf->st_blksize;
267 lbuf.st_blocks = buf->st_blocks;
268 lbuf.st_flags = buf->st_flags;
269 lbuf.st_gen = buf->st_gen;
270
271 return (copyout(&lbuf, ubuf, sizeof(lbuf)));
272}
273

--- 219 unchanged lines hidden (view full) ---

493 lbuf.st_dev = minor(buf->st_dev) | (major(buf->st_dev) << 8);
494 lbuf.st_ino = buf->st_ino;
495 lbuf.st_mode = buf->st_mode;
496 lbuf.st_nlink = buf->st_nlink;
497 lbuf.st_uid = buf->st_uid;
498 lbuf.st_gid = buf->st_gid;
499 lbuf.st_rdev = buf->st_rdev;
500 lbuf.st_size = buf->st_size;
272 lbuf.st_blksize = buf->st_blksize;
273 lbuf.st_blocks = buf->st_blocks;
274 lbuf.st_flags = buf->st_flags;
275 lbuf.st_gen = buf->st_gen;
276
277 return (copyout(&lbuf, ubuf, sizeof(lbuf)));
278}
279

--- 219 unchanged lines hidden (view full) ---

499 lbuf.st_dev = minor(buf->st_dev) | (major(buf->st_dev) << 8);
500 lbuf.st_ino = buf->st_ino;
501 lbuf.st_mode = buf->st_mode;
502 lbuf.st_nlink = buf->st_nlink;
503 lbuf.st_uid = buf->st_uid;
504 lbuf.st_gid = buf->st_gid;
505 lbuf.st_rdev = buf->st_rdev;
506 lbuf.st_size = buf->st_size;
501 lbuf.st_atime = buf->st_atime;
502 lbuf.st_mtime = buf->st_mtime;
503 lbuf.st_ctime = buf->st_ctime;
507 lbuf.st_atim.tv_sec = buf->st_atim.tv_sec;
508 lbuf.st_atim.tv_nsec = buf->st_atim.tv_nsec;
509 lbuf.st_mtim.tv_sec = buf->st_mtim.tv_sec;
510 lbuf.st_mtim.tv_nsec = buf->st_mtim.tv_nsec;
511 lbuf.st_ctim.tv_sec = buf->st_ctim.tv_sec;
512 lbuf.st_ctim.tv_nsec = buf->st_ctim.tv_nsec;
504 lbuf.st_blksize = buf->st_blksize;
505 lbuf.st_blocks = buf->st_blocks;
506
507 /*
508 * The __st_ino field makes all the difference. In the Linux kernel
509 * it is conditionally compiled based on STAT64_HAS_BROKEN_ST_INO,
510 * but without the assignment to __st_ino the runtime linker refuses
511 * to mmap(2) any shared libraries. I guess it's broken alright :-)

--- 96 unchanged lines hidden ---
513 lbuf.st_blksize = buf->st_blksize;
514 lbuf.st_blocks = buf->st_blocks;
515
516 /*
517 * The __st_ino field makes all the difference. In the Linux kernel
518 * it is conditionally compiled based on STAT64_HAS_BROKEN_ST_INO,
519 * but without the assignment to __st_ino the runtime linker refuses
520 * to mmap(2) any shared libraries. I guess it's broken alright :-)

--- 96 unchanged lines hidden ---