From c0d15da345194d829228e863ca7b2a20dceb91c1 Mon Sep 17 00:00:00 2001 From: Henny Sipma Date: Tue, 20 Oct 2026 21:48:36 -0700 Subject: [PATCH] CHB: pthread summaries --- CodeHawk/CHB/bchlib/bCHBCTypeXml.ml | 2 + .../bchsummaries/so_functions/localtime_r.xml | 43 ++++++++++++++++++ .../CHB/bchsummaries/so_functions/mkfifo.xml | 43 ++++++++++++++++++ .../so_functions/pthread_attr_destroy.xml | 34 ++++++++++++++ .../so_functions/pthread_attr_init.xml | 34 ++++++++++++++ .../pthread_attr_setstacksize.xml | 43 ++++++++++++++++++ .../so_functions/pthread_cancel.xml | 33 ++++++++++++++ .../so_functions/pthread_detach.xml | 33 ++++++++++++++ .../so_functions/pthread_join.xml | 43 ++++++++++++++++++ .../so_functions/pthread_rwlock_destroy.xml | 34 ++++++++++++++ .../so_functions/pthread_rwlock_init.xml | 44 +++++++++++++++++++ .../so_functions/pthread_rwlock_rdlock.xml | 34 ++++++++++++++ .../so_functions/pthread_rwlock_unlock.xml | 34 ++++++++++++++ .../so_functions/pthread_rwlock_wrlock.xml | 34 ++++++++++++++ .../so_functions/pthread_self.xml | 26 +++++++++++ .../bchsummaries/so_functions/rewinddir.xml | 29 ++++++++++++ .../CHB/bchsummaries/so_functions/sysconf.xml | 31 +++++++++++++ .../CHB/bchsummaries/so_functions/tcdrain.xml | 31 +++++++++++++ 18 files changed, 605 insertions(+) create mode 100644 CodeHawk/CHB/bchsummaries/so_functions/localtime_r.xml create mode 100644 CodeHawk/CHB/bchsummaries/so_functions/mkfifo.xml create mode 100644 CodeHawk/CHB/bchsummaries/so_functions/pthread_attr_destroy.xml create mode 100644 CodeHawk/CHB/bchsummaries/so_functions/pthread_attr_init.xml create mode 100644 CodeHawk/CHB/bchsummaries/so_functions/pthread_attr_setstacksize.xml create mode 100644 CodeHawk/CHB/bchsummaries/so_functions/pthread_cancel.xml create mode 100644 CodeHawk/CHB/bchsummaries/so_functions/pthread_detach.xml create mode 100644 CodeHawk/CHB/bchsummaries/so_functions/pthread_join.xml create mode 100644 CodeHawk/CHB/bchsummaries/so_functions/pthread_rwlock_destroy.xml create mode 100644 CodeHawk/CHB/bchsummaries/so_functions/pthread_rwlock_init.xml create mode 100644 CodeHawk/CHB/bchsummaries/so_functions/pthread_rwlock_rdlock.xml create mode 100644 CodeHawk/CHB/bchsummaries/so_functions/pthread_rwlock_unlock.xml create mode 100644 CodeHawk/CHB/bchsummaries/so_functions/pthread_rwlock_wrlock.xml create mode 100644 CodeHawk/CHB/bchsummaries/so_functions/pthread_self.xml create mode 100644 CodeHawk/CHB/bchsummaries/so_functions/rewinddir.xml create mode 100644 CodeHawk/CHB/bchsummaries/so_functions/sysconf.xml create mode 100644 CodeHawk/CHB/bchsummaries/so_functions/tcdrain.xml diff --git a/CodeHawk/CHB/bchlib/bCHBCTypeXml.ml b/CodeHawk/CHB/bchlib/bCHBCTypeXml.ml index 306a81a2..4c2a89ff 100644 --- a/CodeHawk/CHB/bchlib/bCHBCTypeXml.ml +++ b/CodeHawk/CHB/bchlib/bCHBCTypeXml.ml @@ -78,6 +78,8 @@ let ch_named_struct_types = [ "ch__pthread_cond_t"; "ch__pthread_mutex_t"; "ch__pthread_mutexattr_t"; + "ch__pthread_rwlock_t"; + "ch__pthread_rwlockattr_t"; "ch__pthread_start_routine"; "ch__pthread_t"; "ch__rlimit"; (* used in getrlimit *) diff --git a/CodeHawk/CHB/bchsummaries/so_functions/localtime_r.xml b/CodeHawk/CHB/bchsummaries/so_functions/localtime_r.xml new file mode 100644 index 00000000..09bd4b01 --- /dev/null +++ b/CodeHawk/CHB/bchsummaries/so_functions/localtime_r.xml @@ -0,0 +1,43 @@ + + + +
+ + + convert a time value to a broken-down local time + + + struct tm *localtime_r( + const time_t *restrict timer + struct tm *restrict result + ) + + time in seconds pointed to + result structure + + pointer to broken down time structure + NULL + + + + + + time_t +
+
+ + ch__tm + + ch__tm +
+ + + + + + + + +
+ Copyright 2012-2026, Henny Sipma, Palo Alto, CA 94304 + diff --git a/CodeHawk/CHB/bchsummaries/so_functions/mkfifo.xml b/CodeHawk/CHB/bchsummaries/so_functions/mkfifo.xml new file mode 100644 index 00000000..6b120eb5 --- /dev/null +++ b/CodeHawk/CHB/bchsummaries/so_functions/mkfifo.xml @@ -0,0 +1,43 @@ + + + +
+ + + make a FIFO special file + + + int mkfifo( + const char *path + mode_t mode + ) + + name of file to be created + file permissions + + zero + -1 + + + + + + char +
+
+ + mode_t + + int +
+ + + + + + + + +
+ Copyright 2012-2026, Henny Sipma, Palo Alto, CA 94304 + diff --git a/CodeHawk/CHB/bchsummaries/so_functions/pthread_attr_destroy.xml b/CodeHawk/CHB/bchsummaries/so_functions/pthread_attr_destroy.xml new file mode 100644 index 00000000..596a68e7 --- /dev/null +++ b/CodeHawk/CHB/bchsummaries/so_functions/pthread_attr_destroy.xml @@ -0,0 +1,34 @@ + + + +
+ + + destroy the thread attributes object + + int pthread_attr_destroy (pthread_attr_t *attr) + thread attributes object to be destroyed + + zero + error-number + + + + + + ch__pthread_attr_t +
+
+ int +
+ + + + + + + + +
+ Copyright 2012-2026, Henny Sipma, Palo Alto, CA 94304 + diff --git a/CodeHawk/CHB/bchsummaries/so_functions/pthread_attr_init.xml b/CodeHawk/CHB/bchsummaries/so_functions/pthread_attr_init.xml new file mode 100644 index 00000000..8d7a0713 --- /dev/null +++ b/CodeHawk/CHB/bchsummaries/so_functions/pthread_attr_init.xml @@ -0,0 +1,34 @@ + + + +
+ + + initialize the thread attributes object + + int pthread_attr_init (pthread_attr_t *attr) + thread attributes object to be initialized + + zero + error number + + + + + + ch__pthread_attr_t +
+
+ int +
+ + + + + + + + +
+ Copyright 2012-2026, Henny Sipma, Palo Alto, CA 94304 + diff --git a/CodeHawk/CHB/bchsummaries/so_functions/pthread_attr_setstacksize.xml b/CodeHawk/CHB/bchsummaries/so_functions/pthread_attr_setstacksize.xml new file mode 100644 index 00000000..015de2ca --- /dev/null +++ b/CodeHawk/CHB/bchsummaries/so_functions/pthread_attr_setstacksize.xml @@ -0,0 +1,43 @@ + + + +
+ + + set the stacksize attribute + + + int pthread_attr_setstacksize( + pthread_attr_t *attr + size_t stacksize + ) + + attributes object + minimum stacksize + + zero + error number + + + + + + ch__pthread_attr_t +
+
+ + size_t + + int +
+ + + + + + + + +
+ Copyright 2012-2026, Henny Sipma, Palo Alto, CA 94304 + diff --git a/CodeHawk/CHB/bchsummaries/so_functions/pthread_cancel.xml b/CodeHawk/CHB/bchsummaries/so_functions/pthread_cancel.xml new file mode 100644 index 00000000..09ba23bb --- /dev/null +++ b/CodeHawk/CHB/bchsummaries/so_functions/pthread_cancel.xml @@ -0,0 +1,33 @@ + + + +
+ + + cancel execution of a thread + + pthread_cancel (pthread_t thread) + target thread to be canceled + + zero + error number + + + + + + ch__pthread_t + + int + + + + + + + + + + + Copyright 2012-2026, Henny Sipma, Palo Alto, CA 94304 + diff --git a/CodeHawk/CHB/bchsummaries/so_functions/pthread_detach.xml b/CodeHawk/CHB/bchsummaries/so_functions/pthread_detach.xml new file mode 100644 index 00000000..652a0637 --- /dev/null +++ b/CodeHawk/CHB/bchsummaries/so_functions/pthread_detach.xml @@ -0,0 +1,33 @@ + + + +
+ + + detach a thread + + int pthread_detach (pthread_t thread) + thread to be detached + + zero + error number + + + + + + ch__pthread_t + + int + + + + + + + + + + + Copyright 2012-2026, Henny Sipma, Palo Alto, CA 94304 + diff --git a/CodeHawk/CHB/bchsummaries/so_functions/pthread_join.xml b/CodeHawk/CHB/bchsummaries/so_functions/pthread_join.xml new file mode 100644 index 00000000..789abe7d --- /dev/null +++ b/CodeHawk/CHB/bchsummaries/so_functions/pthread_join.xml @@ -0,0 +1,43 @@ + + + +
+ + + wait for thread termination + + + int pthread_join( + pthread_t thread + void **value_ptr + ) + + target thread to wait for + location to hold the exit value + + zero + non-zero + + + + + + ch__pthread_t + + + void +
+
+ int +
+ + + + + + + + +
+ Copyright 2012-2026, Henny Sipma, Palo Alto, CA 94304 + diff --git a/CodeHawk/CHB/bchsummaries/so_functions/pthread_rwlock_destroy.xml b/CodeHawk/CHB/bchsummaries/so_functions/pthread_rwlock_destroy.xml new file mode 100644 index 00000000..13931af2 --- /dev/null +++ b/CodeHawk/CHB/bchsummaries/so_functions/pthread_rwlock_destroy.xml @@ -0,0 +1,34 @@ + + + +
+ + + destroy a read-write lock object + + int pthread_rwlock_destroy (pthread_rwlock_t *rwlock) + read-write lock + + zero + non-zero + + + + + + ch__pthread_rwlock_t +
+
+ int +
+ + + + + + + + +
+ Copyright 2012-2026, Henny Sipma, Palo Alto, CA 94304 + diff --git a/CodeHawk/CHB/bchsummaries/so_functions/pthread_rwlock_init.xml b/CodeHawk/CHB/bchsummaries/so_functions/pthread_rwlock_init.xml new file mode 100644 index 00000000..9b8198a3 --- /dev/null +++ b/CodeHawk/CHB/bchsummaries/so_functions/pthread_rwlock_init.xml @@ -0,0 +1,44 @@ + + + +
+ + + initialise a read-write lock object + + + int pthread_rwlock_init( + pthread_rwlock_t *rwlock + const pthread_rwlockattr_t *attr + ) + + read-write lock + optional attributes for initialization + + zero + error number + + + + + + ch__pthread_rwlock_t +
+
+ + ch__pthread_rwlockattr_t +
+
+ int +
+ + + + + + + + +
+ Copyright 2012-2026, Henny Sipma, Palo Alto, CA 94304 + diff --git a/CodeHawk/CHB/bchsummaries/so_functions/pthread_rwlock_rdlock.xml b/CodeHawk/CHB/bchsummaries/so_functions/pthread_rwlock_rdlock.xml new file mode 100644 index 00000000..f433ff28 --- /dev/null +++ b/CodeHawk/CHB/bchsummaries/so_functions/pthread_rwlock_rdlock.xml @@ -0,0 +1,34 @@ + + + +
+ + + lock a read-write lock object for reading + + int pthread_rwlock_rdlock (pthread_rwlock_t *rwlock) + read-write lock + + zero + error-number + + + + + + ch__pthread_rwlock_t +
+
+ int +
+ + + + + + + + +
+ Copyright 2012-2026, Henny Sipma, Palo Alto, CA 94304 + diff --git a/CodeHawk/CHB/bchsummaries/so_functions/pthread_rwlock_unlock.xml b/CodeHawk/CHB/bchsummaries/so_functions/pthread_rwlock_unlock.xml new file mode 100644 index 00000000..3cde150a --- /dev/null +++ b/CodeHawk/CHB/bchsummaries/so_functions/pthread_rwlock_unlock.xml @@ -0,0 +1,34 @@ + + + +
+ + + unlock a read-write lock object + + int pthread_rwlock_unlock (pthread_rwlock_t *rwlock) + read-write lock + + zero + error-number + + + + + + ch__pthread_rwlock_t +
+
+ int +
+ + + + + + + + +
+ Copyright 2012-2026, Henny Sipma, Palo Alto, CA 94304 + diff --git a/CodeHawk/CHB/bchsummaries/so_functions/pthread_rwlock_wrlock.xml b/CodeHawk/CHB/bchsummaries/so_functions/pthread_rwlock_wrlock.xml new file mode 100644 index 00000000..de0862ee --- /dev/null +++ b/CodeHawk/CHB/bchsummaries/so_functions/pthread_rwlock_wrlock.xml @@ -0,0 +1,34 @@ + + + +
+ + + lock a read-write lock object for writing + + int pthread_rwlock_wrlock (pthread_rwlock_t *rwlock) + read-write lock + + zero + error-number + + + + + + ch__pthread_rwlock_t +
+
+ int +
+ + + + + + + + +
+ Copyright 2012-2026, Henny Sipma, Palo Alto, CA 94304 + diff --git a/CodeHawk/CHB/bchsummaries/so_functions/pthread_self.xml b/CodeHawk/CHB/bchsummaries/so_functions/pthread_self.xml new file mode 100644 index 00000000..7eb6b161 --- /dev/null +++ b/CodeHawk/CHB/bchsummaries/so_functions/pthread_self.xml @@ -0,0 +1,26 @@ + + + +
+ + + get the calling thread ID + + pthread_t pthread_self (void) + + thread ID of the calling thread + + + + + ch__pthread_t + + + + + + + + + Copyright 2012-2026, Henny Sipma, Palo Alto, CA 94304 + diff --git a/CodeHawk/CHB/bchsummaries/so_functions/rewinddir.xml b/CodeHawk/CHB/bchsummaries/so_functions/rewinddir.xml new file mode 100644 index 00000000..35b2d078 --- /dev/null +++ b/CodeHawk/CHB/bchsummaries/so_functions/rewinddir.xml @@ -0,0 +1,29 @@ + + + +
+ + + reset the position of a directory stream to the beginning of a directory + + void rewinddir (DIR *dirp) + directory stream to be rewound + + + + + + ch__DIR +
+
+ void +
+ + + + + + +
+ Copyright 2012-2026, Henny Sipma, Palo Alto, CA 94304 + diff --git a/CodeHawk/CHB/bchsummaries/so_functions/sysconf.xml b/CodeHawk/CHB/bchsummaries/so_functions/sysconf.xml new file mode 100644 index 00000000..a988ac5c --- /dev/null +++ b/CodeHawk/CHB/bchsummaries/so_functions/sysconf.xml @@ -0,0 +1,31 @@ + + + +
+ + + get configurable system variables + + long sysconf (int name) + system variable to be queried + + current value on the system + -1 + + + + + + int + + long + + + + + + + + + Copyright 2012-2026, Henny Sipma, Palo Alto, CA 94304 + diff --git a/CodeHawk/CHB/bchsummaries/so_functions/tcdrain.xml b/CodeHawk/CHB/bchsummaries/so_functions/tcdrain.xml new file mode 100644 index 00000000..309b85d2 --- /dev/null +++ b/CodeHawk/CHB/bchsummaries/so_functions/tcdrain.xml @@ -0,0 +1,31 @@ + + + +
+ + + wait for transmission of output + + int tcdrain (int fildes) + file descriptor + + zero + -1 + + + + + + int + + int + + + + + + + + + Copyright 2012-2026, Henny Sipma, Palo Alto, CA 94304 +