summaryrefslogtreecommitdiff
path: root/src/stdio
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-03-20 00:16:43 -0400
committerRich Felker <dalias@aerifal.cx>2011-03-20 00:16:43 -0400
commitaa398f56fa398f2202b04e82c67f822f3233786f (patch)
tree7833c046c55b3d2b67c66433bacfa429a650d310 /src/stdio
parentbe82e122bf37fdcd1766d1ed220f0300b30ab6a3 (diff)
downloadmusl-aa398f56fa398f2202b04e82c67f822f3233786f.tar.gz
global cleanup to use the new syscall interface
Diffstat (limited to 'src/stdio')
-rw-r--r--src/stdio/__fdopen.c6
-rw-r--r--src/stdio/__fopen_rb_ca.c2
-rw-r--r--src/stdio/__lockfile.c2
-rw-r--r--src/stdio/__stdio_close.c2
-rw-r--r--src/stdio/__stdio_read.c2
-rw-r--r--src/stdio/__stdio_seek.c6
-rw-r--r--src/stdio/__stdio_write.c2
-rw-r--r--src/stdio/fopen.c4
-rw-r--r--src/stdio/freopen.c6
-rw-r--r--src/stdio/remove.c2
-rw-r--r--src/stdio/rename.c2
-rw-r--r--src/stdio/tmpfile.c2
12 files changed, 19 insertions, 19 deletions
diff --git a/src/stdio/__fdopen.c b/src/stdio/__fdopen.c
index 6ad7c57d..235d348f 100644
--- a/src/stdio/__fdopen.c
+++ b/src/stdio/__fdopen.c
@@ -20,8 +20,8 @@ FILE *__fdopen(int fd, const char *mode)
/* Set append mode on fd if opened for append */
if (*mode == 'a') {
- int flags = __syscall_fcntl(fd, F_GETFL, 0);
- __syscall_fcntl(fd, F_SETFL, flags | O_APPEND);
+ int flags = syscall(SYS_fcntl, fd, F_GETFL, 0);
+ syscall(SYS_fcntl, fd, F_SETFL, flags | O_APPEND);
}
f->fd = fd;
@@ -30,7 +30,7 @@ FILE *__fdopen(int fd, const char *mode)
/* Activate line buffered mode for terminals */
f->lbf = EOF;
- if (!(f->flags & F_NOWR) && !__syscall_ioctl(fd, TCGETS, &tio))
+ if (!(f->flags & F_NOWR) && !syscall(SYS_ioctl, fd, TCGETS, &tio))
f->lbf = '\n';
/* Initialize op ptrs. No problem if some are unneeded. */
diff --git a/src/stdio/__fopen_rb_ca.c b/src/stdio/__fopen_rb_ca.c
index 57d9b73c..4ba50d61 100644
--- a/src/stdio/__fopen_rb_ca.c
+++ b/src/stdio/__fopen_rb_ca.c
@@ -4,7 +4,7 @@ FILE *__fopen_rb_ca(const char *filename, FILE *f, unsigned char *buf, size_t le
{
memset(f, 0, sizeof *f);
- f->fd = __syscall_open(filename, O_RDONLY, 0);
+ f->fd = syscall(SYS_open, filename, O_RDONLY|O_LARGEFILE, 0);
if (f->fd < 0) return 0;
f->flags = F_NOWR | F_PERM;
diff --git a/src/stdio/__lockfile.c b/src/stdio/__lockfile.c
index 82f50b42..e4320f05 100644
--- a/src/stdio/__lockfile.c
+++ b/src/stdio/__lockfile.c
@@ -13,7 +13,7 @@ void __lockfile(FILE *f)
spins = 100000;
while (a_swap(&f->lock, 1))
if (spins) spins--, a_spin();
- else syscall0(__NR_sched_yield);
+ else syscall(SYS_sched_yield);
f->owner = __pthread_self()->tid;
f->lockcount = 1;
}
diff --git a/src/stdio/__stdio_close.c b/src/stdio/__stdio_close.c
index 24fef33f..9f7ee18c 100644
--- a/src/stdio/__stdio_close.c
+++ b/src/stdio/__stdio_close.c
@@ -2,5 +2,5 @@
int __stdio_close(FILE *f)
{
- return __syscall_close(f->fd);
+ return syscall(SYS_close, f->fd);
}
diff --git a/src/stdio/__stdio_read.c b/src/stdio/__stdio_read.c
index ee7e1258..d9bb3269 100644
--- a/src/stdio/__stdio_read.c
+++ b/src/stdio/__stdio_read.c
@@ -2,5 +2,5 @@
size_t __stdio_read(FILE *f, unsigned char *buf, size_t len)
{
- return __syscall_read(f->fd, buf, len);
+ return syscall(SYS_read, f->fd, buf, len);
}
diff --git a/src/stdio/__stdio_seek.c b/src/stdio/__stdio_seek.c
index c7a5b730..c205ab82 100644
--- a/src/stdio/__stdio_seek.c
+++ b/src/stdio/__stdio_seek.c
@@ -8,11 +8,11 @@ static off_t retneg1(FILE *f, off_t off, int whence)
off_t __stdio_seek(FILE *f, off_t off, int whence)
{
off_t ret;
-#ifdef __NR__llseek
- if (syscall5(__NR__llseek, f->fd, off>>32, off, (long)&ret, whence)<0)
+#ifdef SYS__llseek
+ if (syscall(SYS__llseek, f->fd, off>>32, off, &ret, whence)<0)
ret = -1;
#else
- ret = syscall3(__NR_lseek, f->fd, off, whence);
+ ret = syscall(SYS_lseek, f->fd, off, whence);
#endif
/* Detect unseekable files and optimize future failures out */
if (ret < 0 && off == 0 && whence == SEEK_CUR)
diff --git a/src/stdio/__stdio_write.c b/src/stdio/__stdio_write.c
index 78545626..d4264eff 100644
--- a/src/stdio/__stdio_write.c
+++ b/src/stdio/__stdio_write.c
@@ -4,6 +4,6 @@ size_t __stdio_write(FILE *f, const unsigned char *buf, size_t len)
{
const unsigned char *stop = buf+len;
ssize_t cnt = 1;
- for (; buf<stop && (cnt=__syscall_write(f->fd, buf, len))>0; buf+=cnt);
+ for (; buf<stop && (cnt=syscall(SYS_write, f->fd, buf, len))>0; buf+=cnt);
return len-(stop-buf);
}
diff --git a/src/stdio/fopen.c b/src/stdio/fopen.c
index 670cf5f3..c2a350d1 100644
--- a/src/stdio/fopen.c
+++ b/src/stdio/fopen.c
@@ -21,13 +21,13 @@ FILE *fopen(const char *filename, const char *mode)
if (*mode == 'w') flags |= O_TRUNC;
if (*mode == 'a') flags |= O_APPEND;
- fd = __syscall_open(filename, flags, 0666);
+ fd = syscall(SYS_open, filename, flags|O_LARGEFILE, 0666);
if (fd < 0) return 0;
f = __fdopen(fd, mode);
if (f) return f;
- __syscall_close(fd);
+ syscall(SYS_close, fd);
return 0;
}
diff --git a/src/stdio/freopen.c b/src/stdio/freopen.c
index 8d3af9fc..958dbd20 100644
--- a/src/stdio/freopen.c
+++ b/src/stdio/freopen.c
@@ -17,13 +17,13 @@ FILE *freopen(const char *filename, const char *mode, FILE *f)
if (!filename) {
f2 = fopen("/dev/null", mode);
if (!f2) goto fail;
- fl = __syscall_fcntl(f2->fd, F_GETFL, 0);
- if (fl < 0 || __syscall_fcntl(f->fd, F_SETFL, fl) < 0)
+ fl = syscall(SYS_fcntl, f2->fd, F_GETFL, 0);
+ if (fl < 0 || syscall(SYS_fcntl, f->fd, F_SETFL, fl) < 0)
goto fail2;
} else {
f2 = fopen(filename, mode);
if (!f2) goto fail;
- if (__syscall_dup2(f2->fd, f->fd) < 0)
+ if (syscall(SYS_dup2, f2->fd, f->fd) < 0)
goto fail2;
}
diff --git a/src/stdio/remove.c b/src/stdio/remove.c
index 8e338277..9e1de7f2 100644
--- a/src/stdio/remove.c
+++ b/src/stdio/remove.c
@@ -3,5 +3,5 @@
int remove(const char *path)
{
- return __syscall_unlink(path);
+ return syscall(SYS_unlink, path);
}
diff --git a/src/stdio/rename.c b/src/stdio/rename.c
index 4eced08a..97f14535 100644
--- a/src/stdio/rename.c
+++ b/src/stdio/rename.c
@@ -3,5 +3,5 @@
int rename(const char *old, const char *new)
{
- return syscall2(__NR_rename, (long)old, (long)new);
+ return syscall(SYS_rename, old, new);
}
diff --git a/src/stdio/tmpfile.c b/src/stdio/tmpfile.c
index 185025f1..b050f7fd 100644
--- a/src/stdio/tmpfile.c
+++ b/src/stdio/tmpfile.c
@@ -11,7 +11,7 @@ FILE *tmpfile(void)
for (;;) {
s = tmpnam(buf);
if (!s) return NULL;
- fd = __syscall_open(s, O_RDWR | O_CREAT | O_EXCL, 0600);
+ fd = syscall(SYS_open, s, O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE, 0600);
if (fd >= 0) {
f = __fdopen(fd, "w+");
remove(s);