mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-29 22:40:34 +02:00
Define Scheme bindings to ‘openat’ when available.
* configure.ac: Detect if ‘openat’ is defined. * libguile/filesys.c (flags_to_mode): Extract from ... (scm_mode): ... here. (scm_open_fdes_at, scm_openat): Define the Scheme bindings. * libguile/filesys.h (scm_open_fdes_at, scm_openat): Make them part of the API. * doc/ref/posix.texi (File System): Document them. * test-suite/tests/filesys.test ("openat"): Test ‘openat’. * libguile/syscalls.h (openat_or_openat64): Decide between ‘openat’ and ‘openat64’. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
cf255dd3a4
commit
c8b81ffb34
6 changed files with 169 additions and 23 deletions
|
@ -296,12 +296,25 @@ Create the file if it does not already exist.
|
|||
for additional flags.
|
||||
@end deffn
|
||||
|
||||
@deffn {Scheme Procedure} openat dir path flags [mode]
|
||||
@deffnx {C Function} scm_openat (dir, path, flags, mode)
|
||||
Similar to @code{open}, but resolve the file name @var{path}
|
||||
relative to the directory referred to by the file port @var{dir}
|
||||
instead.
|
||||
@end deffn
|
||||
|
||||
@deffn {Scheme Procedure} open-fdes path flags [mode]
|
||||
@deffnx {C Function} scm_open_fdes (path, flags, mode)
|
||||
Similar to @code{open} but return a file descriptor instead of
|
||||
a port.
|
||||
@end deffn
|
||||
|
||||
@deffn {Scheme Procedure} open-fdes-at dir path flags [mode]
|
||||
@deffnx {C Function} scm_open_fdes_at (dir, path, flags, mode)
|
||||
Similar to @code{openat}, but return a file descriptor instead
|
||||
of a port.
|
||||
@end deffn
|
||||
|
||||
@deffn {Scheme Procedure} close fd_or_port
|
||||
@deffnx {C Function} scm_close (fd_or_port)
|
||||
Similar to @code{close-port} (@pxref{Ports, close-port}),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue