@@ -139,7 +139,7 @@ int chdir(const char *path)
139
139
static __attribute__((unused ))
140
140
int sys_chmod (const char * path , mode_t mode )
141
141
{
142
- #ifdef __NR_fchmodat
142
+ #if defined( __NR_fchmodat )
143
143
return my_syscall4 (__NR_fchmodat , AT_FDCWD , path , mode , 0 );
144
144
#elif defined(__NR_chmod )
145
145
return my_syscall2 (__NR_chmod , path , mode );
@@ -162,7 +162,7 @@ int chmod(const char *path, mode_t mode)
162
162
static __attribute__((unused ))
163
163
int sys_chown (const char * path , uid_t owner , gid_t group )
164
164
{
165
- #ifdef __NR_fchownat
165
+ #if defined( __NR_fchownat )
166
166
return my_syscall5 (__NR_fchownat , AT_FDCWD , path , owner , group , 0 );
167
167
#elif defined(__NR_chown )
168
168
return my_syscall3 (__NR_chown , path , owner , group );
@@ -236,7 +236,7 @@ int dup(int fd)
236
236
static __attribute__((unused ))
237
237
int sys_dup2 (int old , int new )
238
238
{
239
- #ifdef __NR_dup3
239
+ #if defined( __NR_dup3 )
240
240
return my_syscall3 (__NR_dup3 , old , new , 0 );
241
241
#elif defined(__NR_dup2 )
242
242
return my_syscall2 (__NR_dup2 , old , new );
@@ -256,7 +256,7 @@ int dup2(int old, int new)
256
256
* int dup3(int old, int new, int flags);
257
257
*/
258
258
259
- #ifdef __NR_dup3
259
+ #if defined( __NR_dup3 )
260
260
static __attribute__((unused ))
261
261
int sys_dup3 (int old , int new , int flags )
262
262
{
@@ -320,7 +320,7 @@ void exit(int status)
320
320
static __attribute__((unused ))
321
321
pid_t sys_fork (void )
322
322
{
323
- #ifdef __NR_clone
323
+ #if defined( __NR_clone )
324
324
/* note: some archs only have clone() and not fork(). Different archs
325
325
* have a different API, but most archs have the flags on first arg and
326
326
* will not use the rest with no other flag.
@@ -382,7 +382,7 @@ int getdents64(int fd, struct linux_dirent64 *dirp, int count)
382
382
static __attribute__((unused ))
383
383
uid_t sys_geteuid (void )
384
384
{
385
- #ifdef __NR_geteuid32
385
+ #if defined( __NR_geteuid32 )
386
386
return my_syscall0 (__NR_geteuid32 );
387
387
#else
388
388
return my_syscall0 (__NR_geteuid );
@@ -500,7 +500,7 @@ int getpagesize(void)
500
500
static __attribute__((unused ))
501
501
uid_t sys_getuid (void )
502
502
{
503
- #ifdef __NR_getuid32
503
+ #if defined( __NR_getuid32 )
504
504
return my_syscall0 (__NR_getuid32 );
505
505
#else
506
506
return my_syscall0 (__NR_getuid );
@@ -538,7 +538,7 @@ int kill(pid_t pid, int signal)
538
538
static __attribute__((unused ))
539
539
int sys_link (const char * old , const char * new )
540
540
{
541
- #ifdef __NR_linkat
541
+ #if defined( __NR_linkat )
542
542
return my_syscall5 (__NR_linkat , AT_FDCWD , old , AT_FDCWD , new , 0 );
543
543
#elif defined(__NR_link )
544
544
return my_syscall2 (__NR_link , old , new );
@@ -561,7 +561,7 @@ int link(const char *old, const char *new)
561
561
static __attribute__((unused ))
562
562
off_t sys_lseek (int fd , off_t offset , int whence )
563
563
{
564
- #ifdef __NR_lseek
564
+ #if defined( __NR_lseek )
565
565
return my_syscall3 (__NR_lseek , fd , offset , whence );
566
566
#else
567
567
return __nolibc_enosys (__func__ , fd , offset , whence );
@@ -572,7 +572,7 @@ static __attribute__((unused))
572
572
int sys_llseek (int fd , unsigned long offset_high , unsigned long offset_low ,
573
573
__kernel_loff_t * result , int whence )
574
574
{
575
- #ifdef __NR_llseek
575
+ #if defined( __NR_llseek )
576
576
return my_syscall5 (__NR_llseek , fd , offset_high , offset_low , result , whence );
577
577
#else
578
578
return __nolibc_enosys (__func__ , fd , offset_high , offset_low , result , whence );
@@ -609,7 +609,7 @@ off_t lseek(int fd, off_t offset, int whence)
609
609
static __attribute__((unused ))
610
610
int sys_mkdir (const char * path , mode_t mode )
611
611
{
612
- #ifdef __NR_mkdirat
612
+ #if defined( __NR_mkdirat )
613
613
return my_syscall3 (__NR_mkdirat , AT_FDCWD , path , mode );
614
614
#elif defined(__NR_mkdir )
615
615
return my_syscall2 (__NR_mkdir , path , mode );
@@ -631,7 +631,7 @@ int mkdir(const char *path, mode_t mode)
631
631
static __attribute__((unused ))
632
632
int sys_rmdir (const char * path )
633
633
{
634
- #ifdef __NR_rmdir
634
+ #if defined( __NR_rmdir )
635
635
return my_syscall1 (__NR_rmdir , path );
636
636
#elif defined(__NR_unlinkat )
637
637
return my_syscall3 (__NR_unlinkat , AT_FDCWD , path , AT_REMOVEDIR );
@@ -654,7 +654,7 @@ int rmdir(const char *path)
654
654
static __attribute__((unused ))
655
655
long sys_mknod (const char * path , mode_t mode , dev_t dev )
656
656
{
657
- #ifdef __NR_mknodat
657
+ #if defined( __NR_mknodat )
658
658
return my_syscall4 (__NR_mknodat , AT_FDCWD , path , mode , dev );
659
659
#elif defined(__NR_mknod )
660
660
return my_syscall3 (__NR_mknod , path , mode , dev );
@@ -843,7 +843,7 @@ pid_t setsid(void)
843
843
static __attribute__((unused ))
844
844
int sys_symlink (const char * old , const char * new )
845
845
{
846
- #ifdef __NR_symlinkat
846
+ #if defined( __NR_symlinkat )
847
847
return my_syscall3 (__NR_symlinkat , old , AT_FDCWD , new );
848
848
#elif defined(__NR_symlink )
849
849
return my_syscall2 (__NR_symlink , old , new );
@@ -900,7 +900,7 @@ int umount2(const char *path, int flags)
900
900
static __attribute__((unused ))
901
901
int sys_unlink (const char * path )
902
902
{
903
- #ifdef __NR_unlinkat
903
+ #if defined( __NR_unlinkat )
904
904
return my_syscall3 (__NR_unlinkat , AT_FDCWD , path , 0 );
905
905
#elif defined(__NR_unlink )
906
906
return my_syscall1 (__NR_unlink , path );
0 commit comments