diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-09-09 23:14:22 +0200 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-09-13 11:28:09 +0200 |
commit | 9163475a789153de62707173000059f8782f35d8 (patch) | |
tree | de6a414dd2da073c317e74a023d3bbecbed1ca6e /ext/POSIX | |
parent | 792480b6ae5da62a3a9974613560c21925bd14ca (diff) | |
download | perl-9163475a789153de62707173000059f8782f35d8.tar.gz |
Merge the implementations of POSIX::{close,dup,tcdrain} using ALIAS.
On this platform, this reduces the shared object size by about .5K.
Diffstat (limited to 'ext/POSIX')
-rw-r--r-- | ext/POSIX/POSIX.xs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs index afcfe44c16..e09454d619 100644 --- a/ext/POSIX/POSIX.xs +++ b/ext/POSIX/POSIX.xs @@ -1472,14 +1472,6 @@ _exit(status) int status SysRet -close(fd) - int fd - -SysRet -dup(fd) - int fd - -SysRet dup2(fd1, fd2) int fd1 int fd2 @@ -1721,6 +1713,14 @@ mkfifo(filename, mode) SysRet tcdrain(fd) int fd + ALIAS: + close = 1 + dup = 2 + CODE: + RETVAL = ix == 1 ? close(fd) + : (ix < 1 ? tcdrain(fd) : dup(fd)); + OUTPUT: + RETVAL SysRet |