summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/stat.c
AgeCommit message (Collapse)Author
2024-02-27Fix *stat() and *stat64() when the time is beyond year 2038.Dmitry Chestnykh
To obtain correct `st_atim`, `st_mtim` and `st_ctim` fields we need to use statx() syscall and then convert the data from the kernel to the regular stat structure. Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
2021-12-24Fix some warnings due to type issuesYann Sionneau
Fixes those two warnings: In file included from <command-line>: libc/sysdeps/linux/common/openat64.c:18:33: warning: 'openat64' alias between functions of incompatible types 'int(int, const char *, int, ...)' and 'int(int, const char *, int, mode_t)' {aka 'int(int, const char *, int, unsigned int)'} [-Wattribute-alias=] 18 | strong_alias_untyped(__openat64,openat64) | ^~~~~~~~ ./include/libc-symbols.h:177:31: note: in definition of macro '_strong_alias_untyped' 177 | extern __typeof (aliasname) aliasname __attribute__ ((alias (#name))) __attribute_copy__ (name); | ^~~~~~~~~ libc/sysdeps/linux/common/openat64.c:18:1: note: in expansion of macro 'strong_alias_untyped' 18 | strong_alias_untyped(__openat64,openat64) | ^~~~~~~~~~~~~~~~~~~~ libc/sysdeps/linux/common/openat64.c:14:12: note: aliased declaration here 14 | static int __openat64(int fd, const char *file, int oflag, mode_t mode) | ^~~~~~~~~~ and CC libc/sysdeps/linux/common/stat.os libc/sysdeps/linux/common/stat.c: In function 'stat': libc/sysdeps/linux/common/stat.c:28:40: warning: passing argument 3 of 'fstatat64' from incompatible pointer type [-Wincompatible-pointer-types] 28 | return fstatat64(AT_FDCWD, file_name, buf, 0); | ^~~ | | | struct stat * In file included from libc/sysdeps/linux/common/stat.c:11: ./include/sys/stat.h:258:35: note: expected 'struct stat64 * restrict' but argument is of type 'struct stat *' 258 | struct stat64 *__restrict __buf, int __flag) | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~ Signed-off-by: Yann Sionneau <ysionneau@kalray.eu>
2020-02-03csky: add statx conditionalsWaldemar Brodkorb
Similar to glibc commit https://sourceware.org/git/?p=glibc.git;a=commit;h=6bbfc5c09fc5b5e3d4a0cddbbd4e2e457767dae7 we need to handle Linux kernel change, which removed stat64 family from default syscall set. Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> Signed-off-by: Waldemar Brodkorb <wbrodkorb@conet.de>
2018-04-02use __NR_newfstatat only for modern Linux architecturesWaldemar Brodkorb
Otherwise it breaks mips64 n64. Should be used for aarch64/tilegx only.
2017-06-21remove editor hints for viWaldemar Brodkorb
2017-02-01add experimental aarch64 supportWaldemar Brodkorb
Ported over from GNU C Library and runtime tested in Qemu.
2016-11-27remove UCLIBC_HAS_LFSWaldemar Brodkorb
2013-02-20stat: Use fstatat64 if arch does not have the stat syscallMarkos Chandras
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-02-05lstat/stat/fstat: Use 64bit version of syscall if availableKhem Raj
This is needed for stat'ing loop devices > 255 since otherwise kernel returns EOVERFLOW becasue it needs st_rdev/st_dev to be larger than 16bits but in kernel it uses __old_kernel_stat for stat syscall which has st_rdev/st_dev as unsigned short Add a testcase Signed-off-by: Khem Raj <raj.khem@gmail.com>
2009-02-27fix breakage in x86_64 defconfigDenis Vlasenko
2008-11-20Last portion of libc_hidden_proto removal.Denis Vlasenko
Appears to build fine (several .configs tried)
2008-11-20next portion of libc_hidden_proto removalDenis Vlasenko
2008-10-28- trim superfluous ';'. No objcode changesBernhard Reutner-Fischer
2008-07-23- fix inline keywordBernhard Reutner-Fischer
2006-12-08Take Mike Frysinger's comments into account -- make certain that userEric Andersen
applications stop using _syscall#() and use syscall() instead. Cleanup internal handling of syscall includes to use the correct header file.
2006-01-21fix building on 64bit hostsMike Frysinger
2006-01-16s/weak_alias/strong_alias/, only what I knew as needed are kept. We will now ↵Peter S. Mazinger
see what libpthread will do ...
2006-01-15make gcc4 happy w/ hidden_def/proto, correct some typosPeter S. Mazinger
2006-01-14make DODEBUG=y happy, update sysdeps/common/* copyrightPeter S. Mazinger
2006-01-14hidden_def/hidden_proto: convert all users (I hope) termios split, add some ↵Peter S. Mazinger
missing headers, other jump relocs removed
2006-01-14dont include bits/kernel_stat.h as xstatconv.h already does and use ↵Mike Frysinger
sys/stat.h rather than bits/stat.h
2006-01-08fix building on 64bit hostsMike Frysinger
2005-12-16Some undefs to be pedanticPeter S. Mazinger
2005-12-13Convert internal users of chmod/*stat*, minimize change for __strsepPeter S. Mazinger
2005-12-10Do hidden __*stat*Peter S. Mazinger
2005-01-05fix eriks e-mail addressMike Frysinger
2004-01-21Split up syscalls.c, since it had grown to be quite large and ugly.Eric Andersen
-Erik