XinStellaris commented on code in PR #8052: URL: https://github.com/apache/nuttx/pull/8052#discussion_r1065307647
########## include/nuttx/fs/ioctl.h: ########## @@ -405,15 +405,33 @@ /* FIFOs and pipe driver ioctl definitions **********************************/ -#define _PIPEIOCVALID(c) (_IOC_TYPE(c)==_PIPEBASE) -#define _PIPEIOC(nr) _IOC(_PIPEBASE,nr) - -#define PIPEIOC_POLICY _PIPEIOC(0x0001) /* Set buffer policy - * IN: unsigned long integer - * 0=free on last close - * (default) - * 1=fre when empty - * OUT: None */ +#define _PIPEIOCVALID(c) (_IOC_TYPE(c)==_PIPEBASE) +#define _PIPEIOC(nr) _IOC(_PIPEBASE,nr) + +#define PIPEIOC_POLICY _PIPEIOC(0x0001) /* Set buffer policy + * IN: unsigned long integer + * 0=free on last close + * (default) + * 1=fre when empty + * OUT: None */ + +#define PIPEIOC_POLLINTHRD _PIPEIOC(0x0002) /* Set pipe POLLIN + * notifty buffer threshold. + * IN: unsigned long integer. + * POLLIN only occurs when + * buffer contains more Review Comment: I think > for POLLIN/POLLOUT threshold is more reasonable and readable. For example, in local udp socket, we should avoid triggering POLLIN when buffered content is the size of preamble, that is "more than" logic in its nature. Though > and >= both can be implemented, and I can replace it with >= and change default value to 1. I don't think ">=" is more readable. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
