This command does not return an exit status and does not complete. time peekfd <pid> where pid is that of the bash shell since that is the only process that was open on my terminal at that time. after more than an hour, the command had not returned. i wanted to enumerate the file descriptors for processes on my system before i ran into this loophole. who can help put me through on enumerating file descriptors. tnx

i was reading the bash ref guide and trying to understand what file descriptors are.so after "apropos peekfd" and "man peekfd" I ran the command: "time peekfd <pid>" where pid is a running process whose file descriptors i want listed. after more than an hour, the command had not exited or returned, so i decided to look for help.

0 is the standard input (stdin); 1 is the standard output (stdout), and 2 is the standard error (stderr), by convention.

255 is returned to delimit the maximum file descriptors you can open, I think.Or perhaps used not to collide with other ones (e.g., when sourcing). Or both.

0 is a pseudo-terminal slave (PTS) that's a pseudo-device with a text terminal interface, which is usedto communicate with device drivers (programs interacting with hardware devices) thanks to standardinput/output system calls which are processed by the kernel.

They are returned by the character file /dev/ptmx when opened: the process bash getsindependent FDs which are each associated to PTMs which are also associated to theirown PTSs created once the file descriptors are delivered to the process that ask for them.

If you want to intercept system calls, you can use strace(1) per example.

Who is online

Users browsing this forum: No registered users and 8 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum