posix.cfg: Added support for openat(). Reference: http://man7.org/linux/man-pages/man2/openat.2.html

This commit is contained in:
orbitcowboy 2019-04-25 16:56:22 +02:00
parent 76e13c45c7
commit df49b56a6f
1 changed files with 25 additions and 0 deletions

View File

@ -366,6 +366,30 @@
<not-bool/>
</arg>
</function>
<!-- int openat(int dirfd, const char *pathname, int flags); -->
<!-- int openat(int dirfd, const char *pathname, int flags, mode_t mode); -->
<function name="openat">
<!-- TODO: add use-retval when cppcheck suppresses redundant messages
because of violations to alloc/dealloc and use-retval configuration-->
<returnValue type="int"/>
<noreturn>false</noreturn>
<arg nr="1" direction="in">
<valid>0:</valid>
<not-uninit/>
</arg>
<arg nr="2" direction="in">
<not-null/>
<not-uninit/>
</arg>
<arg nr="3" direction="in">
<not-uninit/>
<not-bool/>
</arg>
<arg nr="4" default="0" direction="in">
<not-uninit/>
<not-bool/>
</arg>
</function>
<!-- int creat(const char *pathname, mode_t mode); -->
<function name="creat">
<use-retval/>
@ -4396,6 +4420,7 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s
<resource>
<alloc init="true">open</alloc>
<alloc init="true">creat</alloc>
<alloc init="true">openat</alloc>
<alloc init="true">socket</alloc>
<dealloc>close</dealloc>
</resource>