get number of open files in a process?
Diane Bruce
db at db.net
Thu Jan 21 16:16:45 UTC 2016
On Thu, Jan 21, 2016 at 04:36:36PM +0100, Joerg Sonnenberger wrote:
> On Thu, Jan 21, 2016 at 01:34:18PM +0000, Batutis, Ed wrote:
> > I need to determine the number of open files in my process - all types of file handles total - sockets, files, everything.
>
> Use getdtablesize() to get the current largest known fd. If you want,
> you can afterwards loop and use fcntl with F_GETFD to check if the
> descriptor is still open.
Better off using getrlimit(2)
>
> Joerg
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"
>
Diane
--
- db at FreeBSD.org db at db.net http://www.db.net/~db
More information about the freebsd-hackers
mailing list