posix.cfg: Added support for fgetpwent_r().
This commit is contained in:
parent
86cc410dc2
commit
6c54e7363d
|
@ -3272,6 +3272,33 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s
|
|||
<warn severity="portability">Non reentrant function 'getpwent' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getpwent_r'.</warn>
|
||||
</function>
|
||||
<!-- https://man7.org/linux/man-pages/man3/getpwent_r.3.html-->
|
||||
<!-- int fgetpwent_r(FILE *restrict stream, struct passwd *restrict pwbuf, char *restrict buf, size_t buflen, struct passwd **restrict pwbufp); -->
|
||||
<function name="fgetpwent_r">
|
||||
<use-retval/>
|
||||
<returnValue type="int"/>
|
||||
<noreturn>false</noreturn>
|
||||
<arg nr="1" direction="in">
|
||||
<not-null/>
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
<arg nr="2" direction="in">
|
||||
<not-null/>
|
||||
<not-uninit/>
|
||||
</arg>
|
||||
<arg nr="3" direction="out">
|
||||
<not-null/>
|
||||
<minsize type="argvalue" arg="3"/>
|
||||
</arg>
|
||||
<arg nr="4" direction="in">
|
||||
<not-uninit/>
|
||||
<valid>0:</valid>
|
||||
</arg>
|
||||
<arg nr="5" direction="out">
|
||||
<not-null/>
|
||||
<not-bool/>
|
||||
</arg>
|
||||
</function>
|
||||
<!-- https://man7.org/linux/man-pages/man3/getpwent_r.3.html-->
|
||||
<!-- int getpwent_r(struct passwd *restrict pwbuf, char *restrict buf, size_t buflen, struct passwd **restrict pwbufp); -->
|
||||
<function name="getpwent_r">
|
||||
<use-retval/>
|
||||
|
|
|
@ -35,6 +35,19 @@
|
|||
#include <string.h>
|
||||
#include <strings.h>
|
||||
|
||||
int nullPointer_fgetpwent_r(FILE *restrict stream, struct passwd *restrict pwbuf, char *restrict buf, size_t buflen, struct passwd **restrict pwbufp)
|
||||
{
|
||||
// cppcheck-suppress nullPointer
|
||||
(void) fgetpwent_r(NULL, pwbuf, buf, buflen, pwbufp);
|
||||
// cppcheck-suppress nullPointer
|
||||
(void) fgetpwent_r(stream, NULL, buf, buflen, pwbufp);
|
||||
// cppcheck-suppress nullPointer
|
||||
(void) fgetpwent_r(stream, pwbuf, NULL, buflen, pwbufp);
|
||||
// cppcheck-suppress nullPointer
|
||||
(void) fgetpwent_r(stream, pwbuf, buf, buflen, NULL);
|
||||
return fgetpwent_r(stream, pwbuf, buf, buflen, pwbufp);
|
||||
}
|
||||
|
||||
int nullPointer_getpwent_r(struct passwd *restrict pwbuf, char *restrict buf, size_t buflen, struct passwd **restrict pwbufp)
|
||||
{
|
||||
// cppcheck-suppress nullPointer
|
||||
|
|
Loading…
Reference in New Issue