* Zheng Lv <lv.zheng.2015@xxxxxxxxx> wrote (on 2017-09-26 10:45:39 +0000): > In LDD3, Chapter 6, Section "Restricting Access to a Single User at a Time", the example code returns -EBUSY when the chardev is in use by another user. However, I "man 3p open" and "man 2 open", finding that ERRORS section of either manual didn't mention about EBUSY. > > I would like to ask if it's legal for open() to return -EBUSY. Yes, it is legal. Many drivers return EBUSY when they are only supposed to be opened once. Probably some vga/drm/audio drivers etc. The `open` man page is mostly directed towards (filesystem) files and directories, so all kinds of errors are not covered. Imagine a case where a device requires a interrupt line that can't be shared, in which case EBUSY would be the right thing to return. Thanks, Santosh > > Zheng Lv > -- > To unsubscribe from this list: send the line "unsubscribe linux-newbie" in > the body of a message to majordomo@xxxxxxxxxxxxxxx > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.linux-learn.org/faqs -- -- To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs