On Saturday, February 29, 2020 at 9:32:11 PM UTC+1, Philip Boampong wrote > > Whether it cannot harm is what I'm trying to find out. > If newfd gets closed then a retry loop is racy, see my previous messages. > > [1] > https://stackoverflow.com/questions/23440216/race-condition-when-using-dup2 >
I don't understand. The point of dup2 is that it is atomic. If you are getting an error nothing has happened, no replacement of newfd and no close, so there is no harm in trying again after EBUSY or EINTR. -- 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/80116c1b-9ed2-4edb-8855-13cf806978f2%40googlegroups.com.