Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
51251cad
Commit
51251cad
authored
5 months ago
by
Andre Maroneze
Browse files
Options
Downloads
Patches
Plain Diff
[Libc] fixes and improvements after review
parent
d9ba9820
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
share/libc/dirent.h
+6
-6
6 additions, 6 deletions
share/libc/dirent.h
share/libc/ifaddrs.h
+5
-2
5 additions, 2 deletions
share/libc/ifaddrs.h
share/libc/utmp.h
+19
-19
19 additions, 19 deletions
share/libc/utmp.h
with
30 additions
and
27 deletions
share/libc/dirent.h
+
6
−
6
View file @
51251cad
...
...
@@ -59,7 +59,7 @@ extern int alphasort(const struct dirent **a, const struct dirent **b);
/*@
requires dirp_valid_dir_stream: \subset(dirp,&__fc_opendir[0 .. __FC_FOPEN_MAX-1]);
assigns \result \from dirp, *dirp, __fc_p_opendir;
assigns
__fc_
errno \from dirp, *dirp, __fc_p_opendir;
assigns errno \from dirp, *dirp, __fc_p_opendir;
assigns *dirp \from dirp, *dirp, __fc_p_opendir;
ensures err_or_closed_on_success:
(\result == 0 && dirp->__fc_dir_inode == \null) || \result == -1;
...
...
@@ -73,13 +73,14 @@ extern int dirfd(DIR *fd);
/*@
assigns \result \from __fc_p_opendir;
assigns errno \from indirect:__fc_opendir[0 .. __FC_FOPEN_MAX-1];
assigns __fc_opendir[0 .. __FC_FOPEN_MAX-1] \from __fc_opendir[0 .. __FC_FOPEN_MAX-1];
*/
extern
DIR
*
fdopendir
(
int
fd
);
/*@
assigns \result \from path[0..], __fc_p_opendir;
assigns
__fc_
errno \from path[0..], __fc_p_opendir;
assigns errno \from path[0..], __fc_p_opendir;
ensures result_null_or_valid: \result == \null || \valid(\result);
ensures valid_dir_stream_on_success:
\result != \null ==> \result == &__fc_opendir[\result->__fc_dir_id];
...
...
@@ -92,17 +93,16 @@ extern DIR *opendir(const char *path);
requires dirp_valid_dir_stream: \subset(dirp, &__fc_opendir[0 .. __FC_FOPEN_MAX-1]);
assigns \result \from *dirp, __fc_p_opendir;
assigns dirp->__fc_dir_position \from dirp->__fc_dir_position;
assigns
__fc_
errno \from dirp, *dirp, __fc_p_opendir;
assigns errno \from dirp, *dirp, __fc_p_opendir;
ensures result_null_or_valid: \result == \null || \valid(\result);
*/
extern
struct
dirent
*
readdir
(
DIR
*
dirp
);
/*@
assigns \result \from *dirp, __fc_p_opendir;
assigns *dirp \from *dirp;
assigns *entry \from *entry;
assigns *dirp, *entry \from *dirp;
assigns *result \from entry;
assigns
__fc_
errno \from indirect:*dirp, indirect:*entry;
assigns errno \from indirect:*dirp, indirect:*entry;
*/
extern
int
readdir_r
(
DIR
*
dirp
,
struct
dirent
*
entry
,
struct
dirent
**
result
);
...
...
This diff is collapsed.
Click to expand it.
share/libc/ifaddrs.h
+
5
−
2
View file @
51251cad
...
...
@@ -26,6 +26,7 @@
__PUSH_FC_STDLIB
#include
"__fc_define_sockaddr.h"
#include
"errno.h"
__BEGIN_DECLS
...
...
@@ -59,7 +60,8 @@ struct ifmaddrs {
/*@
allocates *ifap;
assigns \result, *ifap \from \nothing; // missing: \from 'system interfaces'
assigns \result, *ifap, errno \from \nothing;
// missing: \from 'system interfaces'
*/
extern
int
getifaddrs
(
struct
ifaddrs
**
ifap
);
...
...
@@ -71,7 +73,8 @@ extern void freeifaddrs(struct ifaddrs *ifa);
/*@
allocates *ifmap;
assigns \result, *ifmap \from \nothing; // missing: \from 'system interfaces'
assigns \result, *ifmap, errno \from \nothing;
// missing: \from 'system interfaces'
*/
extern
int
getifmaddrs
(
struct
ifmaddrs
**
ifmap
);
...
...
This diff is collapsed.
Click to expand it.
share/libc/utmp.h
+
19
−
19
View file @
51251cad
...
...
@@ -115,16 +115,16 @@ extern void setutent (void);
extern
void
endutent
(
void
);
/*@
assigns \result \from &__fc_get, indirect:__fc_utmp, indirect:*
id
;
assigns __fc_get \from __fc_get, indirect:__fc_utmp, indirect:*
id
;
assigns \result \from &__fc_get, indirect:__fc_utmp, indirect:*
ut
;
assigns __fc_get \from __fc_get, indirect:__fc_utmp, indirect:*
ut
;
*/
extern
struct
utmp
*
getutid
(
const
struct
utmp
*
id
);
extern
struct
utmp
*
getutid
(
const
struct
utmp
*
ut
);
/*@
assigns \result \from &__fc_get, indirect:__fc_utmp, indirect:*
line
;
assigns __fc_get \from __fc_get, indirect:__fc_utmp, indirect:*
line
;
assigns \result \from &__fc_get, indirect:__fc_utmp, indirect:*
ut
;
assigns __fc_get \from __fc_get, indirect:__fc_utmp, indirect:*
ut
;
*/
extern
struct
utmp
*
getutline
(
const
struct
utmp
*
line
);
extern
struct
utmp
*
getutline
(
const
struct
utmp
*
ut
);
/*@
assigns __fc_utmp \from __fc_utmp, *utmp_ptr;
...
...
@@ -134,26 +134,26 @@ extern struct utmp *pututline (const struct utmp *utmp_ptr);
/*@
assigns \result \from indirect:__fc_utmp;
assigns *buf
fer
\from __fc_utmp;
assigns *
result
\from &__fc_utmp;
assigns *
u
buf \from __fc_utmp;
assigns *
ubufp
\from &__fc_utmp;
*/
extern
int
getutent_r
(
struct
utmp
*
buf
fer
,
struct
utmp
**
result
);
extern
int
getutent_r
(
struct
utmp
*
u
buf
,
struct
utmp
**
ubufp
);
/*@
assigns \result \from indirect:*
id
, indirect:__fc_utmp;
assigns *buf
fer
\from indirect:*
id
, __fc_utmp;
assigns *
result
\from indirect:*
id
, &__fc_utmp;
assigns \result \from indirect:*
ut
, indirect:__fc_utmp;
assigns *
u
buf \from indirect:*
ut
, __fc_utmp;
assigns *
ubufp
\from indirect:*
ut
, &__fc_utmp;
*/
extern
int
getutid_r
(
const
struct
utmp
*
id
,
struct
utmp
*
buf
fer
,
struct
utmp
**
result
);
extern
int
getutid_r
(
const
struct
utmp
*
ut
,
struct
utmp
*
u
buf
,
struct
utmp
**
ubufp
);
/*@
assigns \result \from indirect:*
line
, indirect:__fc_utmp;
assigns *buf
fer
\from indirect:*
line
, __fc_utmp;
assigns *
result
\from indirect:*
line
, &__fc_utmp;
assigns \result \from indirect:*
ut
, indirect:__fc_utmp;
assigns *
u
buf \from indirect:*
ut
, __fc_utmp;
assigns *
ubufp
\from indirect:*
ut
, &__fc_utmp;
*/
extern
int
getutline_r
(
const
struct
utmp
*
line
,
struct
utmp
*
buf
fer
,
struct
utmp
**
result
);
extern
int
getutline_r
(
const
struct
utmp
*
ut
,
struct
utmp
*
u
buf
,
struct
utmp
**
ubufp
);
__END_DECLS
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment