posix.cfg: Added support for getlogin_r().
This commit is contained in:
parent
9e9997be32
commit
bfbc7e1549
|
@ -4646,6 +4646,23 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s
|
||||||
<leak-ignore/>
|
<leak-ignore/>
|
||||||
<warn severity="portability">Non reentrant function 'getlogin' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getlogin_r'.</warn>
|
<warn severity="portability">Non reentrant function 'getlogin' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getlogin_r'.</warn>
|
||||||
</function>
|
</function>
|
||||||
|
<!-- https://man7.org/linux/man-pages/man3/getlogin.3.html -->
|
||||||
|
<!-- int getlogin_r(char *buf, size_t bufsize); -->
|
||||||
|
<function name="getlogin_r">
|
||||||
|
<returnValue type="int"/>
|
||||||
|
<use-retval/>
|
||||||
|
<noreturn>false</noreturn>
|
||||||
|
<leak-ignore/>
|
||||||
|
<arg nr="1" direction="out">
|
||||||
|
<not-null/>
|
||||||
|
<minsize type="argvalue" arg="2"/>
|
||||||
|
</arg>
|
||||||
|
<arg nr="2" direction="in">
|
||||||
|
<not-bool/>
|
||||||
|
<not-uninit/>
|
||||||
|
<valid>0:</valid>
|
||||||
|
</arg>
|
||||||
|
</function>
|
||||||
<!-- char *ctermid(char *s); -->
|
<!-- char *ctermid(char *s); -->
|
||||||
<function name="ctermid">
|
<function name="ctermid">
|
||||||
<returnValue type="char *"/>
|
<returnValue type="char *"/>
|
||||||
|
|
|
@ -31,6 +31,13 @@
|
||||||
#include <wchar.h>
|
#include <wchar.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
int nullPointer_getlogin_r(char *buf, size_t bufsize)
|
||||||
|
{
|
||||||
|
// cppcheck-suppress nullPointer
|
||||||
|
(void)getlogin_r(NULL,bufsize);
|
||||||
|
return getlogin_r(buf,bufsize);
|
||||||
|
}
|
||||||
|
|
||||||
ssize_t uninitvar_pread(int fd, void *buf, size_t nbyte, off_t offset)
|
ssize_t uninitvar_pread(int fd, void *buf, size_t nbyte, off_t offset)
|
||||||
{
|
{
|
||||||
int Fd;
|
int Fd;
|
||||||
|
|
Loading…
Reference in New Issue