Skip to content

Commit

Permalink
Add missing thread-unsafe functions to LibraryFunctions (closes #723)
Browse files Browse the repository at this point in the history
  • Loading branch information
sim642 committed Sep 11, 2023
1 parent d97504b commit d3ec617
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/analyses/libraryFunctions.ml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ let c_descs_list: (string * LibraryDesc.t) list = LibraryDsl.[
("difftime", unknown [drop "time1" []; drop "time2" []]);
("system", unknown ~attrs:[ThreadUnsafe] [drop "command" [r]]);
("wcscat", unknown [drop "dest" [r; w]; drop "src" [r]]);
("wctomb", unknown ~attrs:[ThreadUnsafe] [drop "s" [w]; drop "wc" []]);
("wcrtomb", unknown ~attrs:[ThreadUnsafe] [drop "s" [w]; drop "wc" []; drop "ps" [r_deep; w_deep]]);
("wcstombs", unknown ~attrs:[ThreadUnsafe] [drop "dst" [w]; drop "src" [r]; drop "size" []]);
("wcsrtombs", unknown ~attrs:[ThreadUnsafe] [drop "dst" [w]; drop "src" [r_deep; w]; drop "size" []; drop "ps" [r_deep; w_deep]]);
("abs", unknown [drop "j" []]);
("localtime_r", unknown [drop "timep" [r]; drop "result" [w]]);
("strpbrk", unknown [drop "s" [r]; drop "accept" [r]]);
Expand Down Expand Up @@ -142,9 +145,11 @@ let posix_descs_list: (string * LibraryDesc.t) list = LibraryDsl.[
("dlerror", unknown ~attrs:[ThreadUnsafe] []);
("drand48", unknown ~attrs:[ThreadUnsafe] []);
("encrypt", unknown ~attrs:[ThreadUnsafe] [drop "block" [r; w]; drop "edflag" []]);
("setkey", unknown ~attrs:[ThreadUnsafe] [drop "key" [r]]);
("endgrent", unknown ~attrs:[ThreadUnsafe] []);
("endpwent", unknown ~attrs:[ThreadUnsafe] []);
("fcvt", unknown ~attrs:[ThreadUnsafe] [drop "number" []; drop "ndigits" []; drop "decpt" [w]; drop "sign" [w]]);
("ecvt", unknown ~attrs:[ThreadUnsafe] [drop "number" []; drop "ndigits" []; drop "decpt" [w]; drop "sign" [w]]);
("gcvt", unknown ~attrs:[ThreadUnsafe] [drop "number" []; drop "ndigit" []; drop "buf" [w]]);
("getdate", unknown ~attrs:[ThreadUnsafe] [drop "string" [r]]);
("getenv", unknown ~attrs:[ThreadUnsafe] [drop "name" [r]]);
Expand Down Expand Up @@ -279,6 +284,8 @@ let posix_descs_list: (string * LibraryDesc.t) list = LibraryDsl.[
("__sigsetjmp", special [__ "env" [w]; drop "savesigs" []] @@ fun env -> Setjmp { env }); (* has two underscores *)
("sigsetjmp", special [__ "env" [w]; drop "savesigs" []] @@ fun env -> Setjmp { env });
("siglongjmp", special [__ "env" [r]; __ "value" []] @@ fun env value -> Longjmp { env; value });
("ftw", unknown ~attrs:[ThreadUnsafe] [drop "dirpath" [r]; drop "fn" [s]; drop "nopenfd" []]); (* TODO: use Call instead of Spawn *)
("nftw", unknown ~attrs:[ThreadUnsafe] [drop "dirpath" [r]; drop "fn" [s]; drop "nopenfd" []; drop "flags" []]); (* TODO: use Call instead of Spawn *)
]

(** Pthread functions. *)
Expand Down

0 comments on commit d3ec617

Please sign in to comment.