xiaoxiang781216 commented on code in PR #8052: URL: https://github.com/apache/nuttx/pull/8052#discussion_r1065301455
########## 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: should we use >= for PIPEIOC_POLLINTHRD and PIPEIOC_POLLOUTTHRD and change the default valu of d_polloutthrd and d_pollinthrd to 1? ########## drivers/pipes/pipe_common.c: ########## @@ -60,6 +60,26 @@ # define pipe_dumpbuffer(m,a,n) #endif +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: pipecommon_bufferused + ****************************************************************************/ + +static pipe_ndx_t pipecommon_bufferused(FAR struct pipe_dev_s *dev) Review Comment: let' add pipecommon_bufferleft to simplify POLLOUT handing -- 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]
