On Fri, Apr 16, 2010 at 2:32 AM, Dan Fandrich <[email protected]> wrote: > On Thu, Apr 15, 2010 at 10:02:16PM +0200, Nguy�n Thái Ng�c Duy wrote: >> +int fcntl(int fd UNUSED_PARAM, int cmd, ...) >> +{ >> + if (cmd == F_GETFD || cmd == F_SETFD || cmd == F_GETFL) >> + return 0; >> + errno = EINVAL; >> + return -1; >> +} > > Returing 0 makes sense for F_GETFD and F_SETFD, but won't returning 0 be > wrong for F_GETFL if some file status flags are set on open?
There are three use cases in busybox: - echo.c checks for open fd. This helps simple cases, but we will need to deal with it. - most of places, they do ofcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | something). Given that F_SETFL is not supported, it does not matter what F_GETFL returns - ash.c do use F_GETFL in a meaningful way. I have a workaround for that -- Duy _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
