aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2015-08-21 09:57:15 -0700
committerH.J. Lu <hjl.tools@gmail.com>2015-08-21 09:57:15 -0700
commite5dee2c896f04d88defdfa00282fa83f5f4004d8 (patch)
treecaebcffacffc0363dc418694eba18b2ce6b8617b /sysdeps/unix/sysv/linux
parent8c7c251746ce41779637c83e3b35639517f728d5 (diff)
downloadglibc-e5dee2c896f04d88defdfa00282fa83f5f4004d8.tar.xz
glibc-e5dee2c896f04d88defdfa00282fa83f5f4004d8.zip
Revert "Add INLINE_SYSCALL_RETURN/INLINE_SYSCALL_ERROR_RETURN"
This reverts commit 0c5b8b5941e036dcaac69cecee9f01fdf9218e6e.
Diffstat (limited to 'sysdeps/unix/sysv/linux')
-rw-r--r--sysdeps/unix/sysv/linux/adjtime.c5
-rw-r--r--sysdeps/unix/sysv/linux/aio_sigqueue.c3
-rw-r--r--sysdeps/unix/sysv/linux/dl-openat64.c6
-rw-r--r--sysdeps/unix/sysv/linux/eventfd.c19
-rw-r--r--sysdeps/unix/sysv/linux/faccessat.c10
-rw-r--r--sysdeps/unix/sysv/linux/fchmodat.c12
-rw-r--r--sysdeps/unix/sysv/linux/fcntl.c6
-rw-r--r--sysdeps/unix/sysv/linux/fstatfs64.c13
-rw-r--r--sysdeps/unix/sysv/linux/ftruncate64.c5
-rw-r--r--sysdeps/unix/sysv/linux/futimens.c10
-rw-r--r--sysdeps/unix/sysv/linux/futimes.c8
-rw-r--r--sysdeps/unix/sysv/linux/futimesat.c2
-rw-r--r--sysdeps/unix/sysv/linux/fxstat.c21
-rw-r--r--sysdeps/unix/sysv/linux/fxstat64.c8
-rw-r--r--sysdeps/unix/sysv/linux/fxstatat.c11
-rw-r--r--sysdeps/unix/sysv/linux/fxstatat64.c16
-rw-r--r--sysdeps/unix/sysv/linux/gai_sigqueue.c3
-rw-r--r--sysdeps/unix/sysv/linux/getpriority.c14
-rw-r--r--sysdeps/unix/sysv/linux/getrlimit64.c10
-rw-r--r--sysdeps/unix/sysv/linux/llseek.c15
-rw-r--r--sysdeps/unix/sysv/linux/lutimes.c12
-rw-r--r--sysdeps/unix/sysv/linux/lxstat.c21
-rw-r--r--sysdeps/unix/sysv/linux/lxstat64.c8
-rw-r--r--sysdeps/unix/sysv/linux/mmap64.c14
-rw-r--r--sysdeps/unix/sysv/linux/mq_close.c2
-rw-r--r--sysdeps/unix/sysv/linux/mq_open.c8
-rw-r--r--sysdeps/unix/sysv/linux/mq_unlink.c8
-rw-r--r--sysdeps/unix/sysv/linux/msgget.c3
-rw-r--r--sysdeps/unix/sysv/linux/prlimit.c24
-rw-r--r--sysdeps/unix/sysv/linux/pt-raise.c4
-rw-r--r--sysdeps/unix/sysv/linux/raise.c2
-rw-r--r--sysdeps/unix/sysv/linux/readahead.c11
-rw-r--r--sysdeps/unix/sysv/linux/reboot.c3
-rw-r--r--sysdeps/unix/sysv/linux/sched_getaffinity.c18
-rw-r--r--sysdeps/unix/sysv/linux/semget.c3
-rw-r--r--sysdeps/unix/sysv/linux/semop.c3
-rw-r--r--sysdeps/unix/sysv/linux/semtimedop.c5
-rw-r--r--sysdeps/unix/sysv/linux/setrlimit64.c10
-rw-r--r--sysdeps/unix/sysv/linux/shmat.c13
-rw-r--r--sysdeps/unix/sysv/linux/shmdt.c3
-rw-r--r--sysdeps/unix/sysv/linux/shmget.c3
-rw-r--r--sysdeps/unix/sysv/linux/signalfd.c22
-rw-r--r--sysdeps/unix/sysv/linux/sigpending.c2
-rw-r--r--sysdeps/unix/sysv/linux/sigprocmask.c3
-rw-r--r--sysdeps/unix/sysv/linux/sigqueue.c2
-rw-r--r--sysdeps/unix/sysv/linux/speed.c10
-rw-r--r--sysdeps/unix/sysv/linux/statfs64.c14
-rw-r--r--sysdeps/unix/sysv/linux/sysctl.c2
-rw-r--r--sysdeps/unix/sysv/linux/tcsendbrk.c3
-rw-r--r--sysdeps/unix/sysv/linux/tcsetattr.c5
-rw-r--r--sysdeps/unix/sysv/linux/timer_getoverr.c4
-rw-r--r--sysdeps/unix/sysv/linux/timer_gettime.c5
-rw-r--r--sysdeps/unix/sysv/linux/timer_settime.c6
-rw-r--r--sysdeps/unix/sysv/linux/truncate64.c5
-rw-r--r--sysdeps/unix/sysv/linux/ustat.c8
-rw-r--r--sysdeps/unix/sysv/linux/utimensat.c11
-rw-r--r--sysdeps/unix/sysv/linux/utimes.c2
-rw-r--r--sysdeps/unix/sysv/linux/xmknod.c13
-rw-r--r--sysdeps/unix/sysv/linux/xmknodat.c13
-rw-r--r--sysdeps/unix/sysv/linux/xstat.c18
-rw-r--r--sysdeps/unix/sysv/linux/xstat64.c8
-rw-r--r--sysdeps/unix/sysv/linux/xstatconv.c29
62 files changed, 292 insertions, 268 deletions
diff --git a/sysdeps/unix/sysv/linux/adjtime.c b/sysdeps/unix/sysv/linux/adjtime.c
index ad54cf8ff8..b6fb7cf5db 100644
--- a/sysdeps/unix/sysv/linux/adjtime.c
+++ b/sysdeps/unix/sysv/linux/adjtime.c
@@ -61,7 +61,10 @@ ADJTIME (const struct TIMEVAL *itv, struct TIMEVAL *otv)
tmp.tv_sec = itv->tv_sec + itv->tv_usec / 1000000L;
tmp.tv_usec = itv->tv_usec % 1000000L;
if (tmp.tv_sec > MAX_SEC || tmp.tv_sec < MIN_SEC)
- return INLINE_SYSCALL_ERROR_RETURN (-EINVAL, int, -1);
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
tntx.offset = tmp.tv_usec + tmp.tv_sec * 1000000L;
tntx.modes = ADJ_OFFSET_SINGLESHOT;
}
diff --git a/sysdeps/unix/sysv/linux/aio_sigqueue.c b/sysdeps/unix/sysv/linux/aio_sigqueue.c
index c56b94f911..6a48e6251b 100644
--- a/sysdeps/unix/sysv/linux/aio_sigqueue.c
+++ b/sysdeps/unix/sysv/linux/aio_sigqueue.c
@@ -47,8 +47,7 @@ __aio_sigqueue (sig, val, caller_pid)
info.si_uid = getuid ();
info.si_value = val;
- return INLINE_SYSCALL_RETURN (rt_sigqueueinfo, 3, int, info.si_pid,
- sig, &info);
+ return INLINE_SYSCALL (rt_sigqueueinfo, 3, info.si_pid, sig, &info);
}
#else
# include <rt/aio_sigqueue.c>
diff --git a/sysdeps/unix/sysv/linux/dl-openat64.c b/sysdeps/unix/sysv/linux/dl-openat64.c
index ffb13f3acb..732097dd92 100644
--- a/sysdeps/unix/sysv/linux/dl-openat64.c
+++ b/sysdeps/unix/sysv/linux/dl-openat64.c
@@ -31,9 +31,9 @@ openat64 (dfd, file, oflag)
assert (!__OPEN_NEEDS_MODE (oflag));
#ifdef __NR_openat
- return INLINE_SYSCALL_RETURN (openat, 3, int, dfd, file,
- oflag | O_LARGEFILE);
+ return INLINE_SYSCALL (openat, 3, dfd, file, oflag | O_LARGEFILE);
#else
- return INLINE_SYSCALL_ERROR_RETURN (-ENOSYS, int, -1);
+ __set_errno (ENOSYS);
+ return -1;
#endif
}
diff --git a/sysdeps/unix/sysv/linux/eventfd.c b/sysdeps/unix/sysv/linux/eventfd.c
index 1496a0e651..d4ffb3cedc 100644
--- a/sysdeps/unix/sysv/linux/eventfd.c
+++ b/sysdeps/unix/sysv/linux/eventfd.c
@@ -25,14 +25,11 @@ int
eventfd (unsigned int count, int flags)
{
#ifdef __NR_eventfd2
+ int res = INLINE_SYSCALL (eventfd2, 2, count, flags);
# ifndef __ASSUME_EVENTFD2
- INTERNAL_SYSCALL_DECL (err);
- int res = INTERNAL_SYSCALL (eventfd2, err, 2, count, flags);
- if (!__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (res, err))
- || INTERNAL_SYSCALL_ERRNO (res, err) != ENOSYS)
- return res;
+ if (res != -1 || errno != ENOSYS)
# endif
- return INLINE_SYSCALL_RETURN (eventfd2, 2, int, count, flags);
+ return res;
#endif
#ifndef __ASSUME_EVENTFD2
@@ -41,12 +38,16 @@ eventfd (unsigned int count, int flags)
kernel (sys_indirect) before implementing setting flags like
O_NONBLOCK etc. */
if (flags != 0)
- return INLINE_SYSCALL_ERROR_RETURN (-EINVAL, int, -1)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
# ifdef __NR_eventfd
- return INLINE_SYSCALL_RETURN (eventfd, 1, int, count)
+ return INLINE_SYSCALL (eventfd, 1, count);
# else
- return INLINE_SYSCALL_ERROR_RETURN (-ENOSYS, int, -1)
+ __set_errno (ENOSYS);
+ return -1;
# endif
#elif !defined __NR_eventfd2
# error "__ASSUME_EVENTFD2 defined but not __NR_eventfd2"
diff --git a/sysdeps/unix/sysv/linux/faccessat.c b/sysdeps/unix/sysv/linux/faccessat.c
index 6a0b1b7018..1bb544fd4d 100644
--- a/sysdeps/unix/sysv/linux/faccessat.c
+++ b/sysdeps/unix/sysv/linux/faccessat.c
@@ -35,10 +35,13 @@ faccessat (fd, file, mode, flag)
int flag;
{
if (flag & ~(AT_SYMLINK_NOFOLLOW | AT_EACCESS))
- return INLINE_SYSCALL_ERROR_RETURN (-EINVAL, int, -1);
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
if ((flag == 0 || ((flag & ~AT_EACCESS) == 0 && ! __libc_enable_secure)))
- return INLINE_SYSCALL_RETURN (faccessat, 3, int, fd, file, mode);
+ return INLINE_SYSCALL (faccessat, 3, fd, file, mode);
struct stat64 stats;
if (__fxstatat64 (_STAT_VER, fd, file, &stats, flag & AT_SYMLINK_NOFOLLOW))
@@ -71,5 +74,6 @@ faccessat (fd, file, mode, flag)
if (granted == mode)
return 0;
- return INLINE_SYSCALL_ERROR_RETURN (-EACCES, int, -1);
+ __set_errno (EACCES);
+ return -1;
}
diff --git a/sysdeps/unix/sysv/linux/fchmodat.c b/sysdeps/unix/sysv/linux/fchmodat.c
index 025634b278..e278426de1 100644
--- a/sysdeps/unix/sysv/linux/fchmodat.c
+++ b/sysdeps/unix/sysv/linux/fchmodat.c
@@ -34,11 +34,17 @@ fchmodat (fd, file, mode, flag)
int flag;
{
if (flag & ~AT_SYMLINK_NOFOLLOW)
- return INLINE_SYSCALL_ERROR_RETURN (-EINVAL, int, -1);
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
#ifndef __NR_lchmod /* Linux so far has no lchmod syscall. */
if (flag & AT_SYMLINK_NOFOLLOW)
- return INLINE_SYSCALL_ERROR_RETURN (-ENOTSUP, int, -1);
+ {
+ __set_errno (ENOTSUP);
+ return -1;
+ }
#endif
- return INLINE_SYSCALL_RETURN (fchmodat, 3, int, fd, file, mode);
+ return INLINE_SYSCALL (fchmodat, 3, fd, file, mode);
}
diff --git a/sysdeps/unix/sysv/linux/fcntl.c b/sysdeps/unix/sysv/linux/fcntl.c
index a9a6b6548b..fa184db7fe 100644
--- a/sysdeps/unix/sysv/linux/fcntl.c
+++ b/sysdeps/unix/sysv/linux/fcntl.c
@@ -28,7 +28,7 @@ static int
do_fcntl (int fd, int cmd, void *arg)
{
if (cmd != F_GETOWN)
- return INLINE_SYSCALL_RETURN (fcntl, 3, int, fd, cmd, arg);
+ return INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);
INTERNAL_SYSCALL_DECL (err);
struct f_owner_ex fex;
@@ -36,8 +36,8 @@ do_fcntl (int fd, int cmd, void *arg)
if (!INTERNAL_SYSCALL_ERROR_P (res, err))
return fex.type == F_OWNER_GID ? -fex.pid : fex.pid;
- return INLINE_SYSCALL_ERROR_RETURN (-INTERNAL_SYSCALL_ERRNO (res, err),
- int, -1);
+ __set_errno (INTERNAL_SYSCALL_ERRNO (res, err));
+ return -1;
}
diff --git a/sysdeps/unix/sysv/linux/fstatfs64.c b/sysdeps/unix/sysv/linux/fstatfs64.c
index bba99186b5..af8383010f 100644
--- a/sysdeps/unix/sysv/linux/fstatfs64.c
+++ b/sysdeps/unix/sysv/linux/fstatfs64.c
@@ -35,17 +35,12 @@ __fstatfs64 (int fd, struct statfs64 *buf)
if (! __no_statfs64)
# endif
{
+ int result = INLINE_SYSCALL (fstatfs64, 3, fd, sizeof (*buf), buf);
+
# if __ASSUME_STATFS64 == 0
- INTERNAL_SYSCALL_DECL (err);
- int result = INTERNAL_SYSCALL (fstatfs64, err, 3, fd,
- sizeof (*buf), buf);
- if (!__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (result, err))
- || INTERNAL_SYSCALL_ERRNO (result, err) != ENOSYS)
- return result;
-# else
- return INLINE_SYSCALL_RETURN (fstatfs64, 3, int, fd,
- sizeof (*buf), buf);
+ if (result == 0 || errno != ENOSYS)
# endif
+ return result;
# if __ASSUME_STATFS64 == 0
__no_statfs64 = 1;
diff --git a/sysdeps/un