Noticing the close-fdes mirror that wraps close(2) suggests we should change the name of one or both.
They aren't all that symmetrical. Open-file can only open a resource with a name in the filesystem, whereas close-fdes can close any fd. It's undefined what happens if you close a fdes that's part of a Scheme port, but some other SRFIs might need to deal in fd's, particularly the process SRFI.
This will take some thought. It can't just be passed through blindly, because in a green-threads Scheme it would block the whole process.
- O_CLOEXEC
- If set, the FD_CLOEXEC flag for the new file descriptor shall be set.
The process pre-SRFI says that any fd not explicitly mentioned in the make-process call is implicitly closed; I think whitelisting is a better approach.
- O_NOFOLLOW
- If path names a symbolic link, fail and set errno to [ELOOP].
I'm not sure what serious practical use this has, but since the SRFI is symbolic link aware, perhaps it should be added.
Perhaps it should.
John Cowan
http://vrici.lojban.org/~cowan xxxxxx@ccil.orgIs not a patron, my Lord [Chesterfield], one who looks with unconcern
on a man struggling for life in the water, and when he has reached ground
encumbers him with help? --Samuel Johnson