<cr1901_modern1>
Looking at this bug: Are file descriptor ID's "global" to all processes? And isn't this "proper" Unix behavior anyway?
<whitequark>
fds are not global
<whitequark>
and anwyay, the crux of the issue is that using e.g. a epoll fd in both parent and child is undefined
<whitequark>
I believe it's similar on other OSes, and of course no fork on windows
<cr1901_modern1>
Then why did the bug report's minimal example just print out the fds showing they were the same?
<whitequark>
the example is wrong
<cr1901_modern1>
ahhh. Normally if I'm confused, I assume it's me that's not understanding properly lol. Guess it kinda makes sense then to make it undefined, since we wouldn't WANT those fds shared.
_whitelogger has joined #m-labs
whitequark has joined #m-labs
<larsc>
when you fork() the child will get the same open file desciptors with the same fd numbers. but any open() or close() after that will only have an effect in the process where it is executed
<whitequark>
well, not quite, with epoll the fd is not in fact usable
<whitequark>
so it's not "the same fd"
<whitequark>
*not "the same open file", it's just the same fd number
<larsc>
are we talking about the fd number returned by epoll()
<larsc>
?
<whitequark>
yes
<whitequark>
the fd number is the same and it's inherited
<larsc>
yeah, thinks like epoll() and signalfd() and so on are special
<whitequark>
but the pseudo-file it refers to is dead by the time fork returns in the child
<larsc>
and the lesson learned dont use fork()
<whitequark>
posix_spawn. yeah.
<larsc>
unfortunatelly there is no native linux implementation
<whitequark>
wait, there isn't?
<larsc>
it's all clone + exec
kaaliakahn has quit [Remote host closed the connection]
sj_mackenzie has quit [Ping timeout: 252 seconds]
sandeepkr__ has quit [Ping timeout: 252 seconds]
<cr1901_modern1>
sb0: In new Migen API, is there any particular reason you don't use the @decorator syntax for decorators such as CEInserter?
<cr1901_modern1>
Well, I guess you could use them as such, looking more closely...