From 5242eef8fc54636a41701fd9d7083ba6e4a4e0b3 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 26 Jun 2024 18:18:39 +0200 Subject: Merging upstream version 1:4.15.2. Signed-off-by: Daniel Baumann --- lib/commonio.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib/commonio.h') diff --git a/lib/commonio.h b/lib/commonio.h index e63c5b4..fedbefa 100644 --- a/lib/commonio.h +++ b/lib/commonio.h @@ -11,8 +11,11 @@ #ifndef COMMONIO_H #define COMMONIO_H + +#include "attr.h" #include "defines.h" /* bool */ + /* * Linked list entry. */ @@ -37,7 +40,7 @@ struct commonio_ops { /* * free() the object including any strings pointed by it. */ - void (*free) (/*@out@*/ /*@only@*/void *); + void (*free)(/*@only@*/void *); /* * Return the name of the object (for example, pw_name @@ -61,7 +64,9 @@ struct commonio_ops { * fgets and fputs (can be replaced by versions that * understand line continuation conventions). */ - /*@null@*/char *(*fgets) (/*@returned@*/ /*@out@*/char *s, int n, FILE *stream); + ATTR_ACCESS(write_only, 1, 2) + /*@null@*/char *(*fgets)(/*@returned@*/char *restrict s, int n, + FILE *restrict stream); int (*fputs) (const char *, FILE *); /* @@ -123,6 +128,7 @@ extern int commonio_setname (struct commonio_db *, const char *); extern bool commonio_present (const struct commonio_db *db); extern int commonio_lock (struct commonio_db *); extern int commonio_lock_nowait (struct commonio_db *, bool log); +extern int do_fcntl_lock (const char *file, bool log, short type); extern int commonio_open (struct commonio_db *, int); extern /*@observer@*/ /*@null@*/const void *commonio_locate (struct commonio_db *, const char *); extern int commonio_update (struct commonio_db *, const void *); -- cgit v1.2.3