2013/7/8 Eric Dumazet : > On Mon, 2013-07-08 at 19:51 +0400, Andrey Wagin wrote: >> Hi Eric, >> >> 2013/7/8 Eric Dumazet : >> >> Applied >> > >> > It seems it could break ip command for old kernels, as SOCK_CLOEXEC is >> > supported from 2.6.27 >> > >> > Not sure if its worth a patch, to do the normal socket() call followed >> > by legacy fcntl() one. >> >> fcntl is not safe for multithread applications. If libnetlink isn't >> going to be used for them, I don't have objection. The patch is >> attached. >> > > If you want multithread safety, you could attempt the SOCK_CLOEXEC, and > fall back in case of error to legacy socket()/fcntl() > Yes, it's good idea. Look at the attached patch. Thanks. > >