summaryrefslogtreecommitdiff
path: root/ext/POSIX
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-09-09 23:14:22 +0200
committerNicholas Clark <nick@ccl4.org>2011-09-13 11:28:09 +0200
commit9163475a789153de62707173000059f8782f35d8 (patch)
treede6a414dd2da073c317e74a023d3bbecbed1ca6e /ext/POSIX
parent792480b6ae5da62a3a9974613560c21925bd14ca (diff)
downloadperl-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.xs16
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