This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
792480b
)
Merge the implementations of POSIX::{close,dup,tcdrain} using ALIAS.
author
Nicholas Clark
<nick@ccl4.org>
Fri, 9 Sep 2011 21:14:22 +0000
(23:14 +0200)
committer
Nicholas Clark
<nick@ccl4.org>
Tue, 13 Sep 2011 09:28:09 +0000
(11:28 +0200)
On this platform, this reduces the shared object size by about .5K.
ext/POSIX/POSIX.xs
patch
|
blob
|
blame
|
history
diff --git
a/ext/POSIX/POSIX.xs
b/ext/POSIX/POSIX.xs
index
afcfe44
..
e09454d
100644
(file)
--- 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