Re: fd type from number

2014-08-22 Thread Rohan Puri
On Sat, Aug 23, 2014 at 12:33 AM, Loris Degioanni wrote: > On 8/20/2014 2:33 AM, Rohan Puri wrote: >> >> On Tue, Aug 19, 2014 at 10:04 PM, Loris Degioanni >> wrote: >>> >>> Sure, here's some more context. >>> >>> I'm one of the developers of sysdig (www.sysdig.org), a tool that >>> captures syste

Re: fd type from number

2014-08-22 Thread Loris Degioanni
On 8/20/2014 2:33 AM, Rohan Puri wrote: > On Tue, Aug 19, 2014 at 10:04 PM, Loris Degioanni wrote: >> Sure, here's some more context. >> >> I'm one of the developers of sysdig (www.sysdig.org), a tool that >> captures system calls and uses them to offer advanced system monitoring. >> One of the fe

Re: fd type from number

2014-08-20 Thread Rohan Puri
On Tue, Aug 19, 2014 at 10:04 PM, Loris Degioanni wrote: > Sure, here's some more context. > > I'm one of the developers of sysdig (www.sysdig.org), a tool that > captures system calls and uses them to offer advanced system monitoring. > One of the features that our diver offers is the tcpdump-der

Re: fd type from number

2014-08-19 Thread Loris Degioanni
Sure, here's some more context. I'm one of the developers of sysdig (www.sysdig.org), a tool that captures system calls and uses them to offer advanced system monitoring. One of the features that our diver offers is the tcpdump-derived concept of "snaplen": when a system call with a buffer is c

Re: fd type from number

2014-08-19 Thread Loris Degioanni
On 8/19/2014 9:10 AM, Greg KH wrote: > On Tue, Aug 19, 2014 at 08:38:24AM -0700, Loris Degioanni wrote: >> (resending making sure this is not part of another thread) >> >> I'm looking for an efficient way to determine the type of an fd (file, >> socket...) given its number, from a kernel module. >

Re: fd type from number

2014-08-19 Thread Greg KH
On Tue, Aug 19, 2014 at 08:38:24AM -0700, Loris Degioanni wrote: > (resending making sure this is not part of another thread) > > I'm looking for an efficient way to determine the type of an fd (file, > socket...) given its number, from a kernel module. You don't have a "number" from within the

Re: fd type from number

2014-08-19 Thread Valdis . Kletnieks
On Tue, 19 Aug 2014 08:38:24 -0700, Loris Degioanni said: > I'm looking for an efficient way to determine the type of an fd (file, > socket...) given its number, from a kernel module. What problem are you trying to solve here? There may be a better API for your problem. So step back - what are

Re: fd type from number

2014-08-19 Thread Daniel Baluta
On Tue, Aug 19, 2014 at 6:38 PM, Loris Degioanni wrote: > (resending making sure this is not part of another thread) > > I'm looking for an efficient way to determine the type of an fd (file, > socket...) given its number, from a kernel module. > The closest thing I found by looking at the kernel

fd type from number

2014-08-19 Thread Loris Degioanni
(resending making sure this is not part of another thread) I'm looking for an efficient way to determine the type of an fd (file, socket...) given its number, from a kernel module. The closest thing I found by looking at the kernel sources is sockfd_lookup(), which works but is limited to tellin

Re: fd type from number

2014-08-19 Thread Greg Freemyer
On August 18, 2014 8:46:16 PM EDT, Loris Degioanni wrote: >I'm looking for an efficient way to determine the type of an fd (file, >socket...) given its number, from a kernel module. >The closest thing I found by looking at the kernel sources is >sockfd_lookup(), which works but is limited to t

fd type from number

2014-08-18 Thread Loris Degioanni
I'm looking for an efficient way to determine the type of an fd (file, socket...) given its number, from a kernel module. The closest thing I found by looking at the kernel sources is sockfd_lookup(), which works but is limited to telling me if the fd is a socket or not. Is there something else