#include <stdlib.h>
-#include <stdio.h>
#include <limits.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
+#include "syscall.h"
void __procfdname(char *, unsigned);
return 0;
}
- fd = open(filename, O_PATH|O_NONBLOCK|O_CLOEXEC);
+ fd = syscall(SYS_open, filename, O_PATH|O_NONBLOCK|O_CLOEXEC|O_LARGEFILE);
if (fd < 0) return 0;
__procfdname(buf, fd);
goto err;
}
- close(fd);
+ __syscall(SYS_close, fd);
return resolved ? strcpy(resolved, tmp) : strdup(tmp);
err:
- close(fd);
+ __syscall(SYS_close, fd);
return 0;
}