Skip to content

Instantly share code, notes, and snippets.

@alanc
Created July 18, 2019 18:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alanc/977ee7cc8a7aa81cd5f52b71644edc45 to your computer and use it in GitHub Desktop.
Save alanc/977ee7cc8a7aa81cd5f52b71644edc45 to your computer and use it in GitHub Desktop.
closefrom() in Solaris 11.4
Oracle Corporation SunOS 5.11 11.4 June 2019
solaris% cd /tmp
solaris% cat > closefrom.c
#include <stdlib.h>
int main() {
closefrom(3);
}
solaris% cc -o closefrom closefrom.c
solaris% truss -u :: ./closefrom
[...]
/1@1: -> libc:closefrom(0x3, 0x0)
/1@1: -> libc:fcntl(0x3, 0x36, 0xfe2f9d4c, 0xfe1b573d)
/1@1: -> libc:s_fcntl(0x3, 0x36, 0xfe2f9d4c, 0xfe289bce)
/1@1: -> libc:syscall(0x3e, 0x3, 0x36, 0xfe2f9d4c)
fcntl(3, F_CLOSEFROM) = 0
/1@1: <- libc:syscall() = 0
/1@1: <- libc:s_fcntl() = 0
/1@1: <- libc:fcntl() = 0
/1@1: <- libc:closefrom() = 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment