On Sat, Feb 29, 2020 at 12:33 AM Brian Candler <b.cand...@pobox.com> wrote: > > Just to ask the an obvious question: is dup2() idempotent or not?
dup2 in itself is idempotent. But I'm not sure that is a useful question. The issue is whether some other thread in the same process can open a file at the target file descriptor between calls to dup2. To put it another way, dup2 is idempotent, but if you make multiple calls to dup2, the order in which you make those calls matters. Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAOyqgcXzRbjUFRCDXwNf%3DDJK8%2BcVDS8K9AyPng5rEWAQz8BAsg%40mail.gmail.com.