core: Add dup, dup2.
* src/posix.c (dup_, dup2_): New function.
This commit is contained in:
parent
7c63d3df47
commit
35c8408df4
12
src/posix.c
12
src/posix.c
|
@ -380,3 +380,15 @@ getcwd_ () ///((name . "getcwd"))
|
|||
return MAKE_STRING (cstring_to_list (getcwd (buf, PATH_MAX)));
|
||||
}
|
||||
|
||||
SCM
|
||||
dup_ (SCM port) ///((name . "dup"))
|
||||
{
|
||||
return MAKE_NUMBER (dup (VALUE (port)));
|
||||
}
|
||||
|
||||
SCM
|
||||
dup2_ (SCM old, SCM new) ///((name . "dup2"))
|
||||
{
|
||||
dup2 (VALUE (old), VALUE (new));
|
||||
return cell_unspecified;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue