diff options
author | Alexander Bokovoy <ab@samba.org> | 2004-05-06 14:38:31 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:51:26 -0500 |
commit | 5afd47147dc00247b403c5d7f00dc6d605435627 (patch) | |
tree | b0c806676e152f851c6469eef7e2109d7627f66f /source3/smbwrapper | |
parent | 7cb9ca16f6678ce9687512fd3f7892122b4878fe (diff) | |
download | samba-5afd47147dc00247b403c5d7f00dc6d605435627.tar.gz samba-5afd47147dc00247b403c5d7f00dc6d605435627.tar.bz2 samba-5afd47147dc00247b403c5d7f00dc6d605435627.zip |
r516: On GNU/Linux distributions which allow to use both 2.4 and 2.6 kernels
there is SYS_utimes syscall defined at compile time in glibc-kernheaders but
it is available on 2.6 kernels only. Therefore, we can't rely on syscall at
compile time but have to check that behaviour during program execution. An easy
workaround is to have replacement for utimes() implemented within our wrapper and
do not rely on syscall at all. Thus, if REPLACE_UTIME is defined already (by packager),
skip these syscall shortcuts.
(This used to be commit e278e2e6e095b1c01eab307d55edf2cde48dcba2)
Diffstat (limited to 'source3/smbwrapper')
-rw-r--r-- | source3/smbwrapper/realcalls.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source3/smbwrapper/realcalls.h b/source3/smbwrapper/realcalls.h index 6c230dba05..bad89d598c 100644 --- a/source3/smbwrapper/realcalls.h +++ b/source3/smbwrapper/realcalls.h @@ -250,14 +250,27 @@ #define real_rmdir(fn) (syscall(SYS_rmdir, (fn))) #define real_mkdir(fn, mode) (syscall(SYS_mkdir, (fn), (mode))) +/* + * On GNU/Linux distributions which allow to use both 2.4 and 2.6 kernels + * there is SYS_utimes syscall defined at compile time in glibc-kernheaders but + * it is available on 2.6 kernels only. Therefore, we can't rely on syscall at + * compile time but have to check that behaviour during program execution. An easy + * workaround is to have replacement for utimes() implemented within our wrapper and + * do not rely on syscall at all. Thus, if REPLACE_UTIME is defined already (by packager), + * skip these syscall shortcuts. + */ +#ifndef REPLACE_UTIME #ifdef SYS_utime #define real_utime(fn, buf) (syscall(SYS_utime, (fn), (buf))) #else #define REPLACE_UTIME 1 #endif +#endif +#ifndef REPLACE_UTIMES #ifdef SYS_utimes #define real_utimes(fn, buf) (syscall(SYS_utimes, (fn), (buf))) #else #define REPLACE_UTIMES 1 #endif +#endif |