summaryrefslogtreecommitdiffstats
path: root/vendor/modernc.org/libc/libc_openbsd.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2022-03-12 23:02:04 +0100
committerWim <wim@42.be>2022-03-20 14:57:48 +0100
commitaefa70891cfd489fccb8a9567b5bdafb0f863ede (patch)
tree90fe7c91d7b33b2a1ed08ea3a94840860adc6fc1 /vendor/modernc.org/libc/libc_openbsd.go
parent1b9877fda45be021ea6a5677c78648cecc19dcd5 (diff)
downloadmatterbridge-msglm-aefa70891cfd489fccb8a9567b5bdafb0f863ede.tar.gz
matterbridge-msglm-aefa70891cfd489fccb8a9567b5bdafb0f863ede.tar.bz2
matterbridge-msglm-aefa70891cfd489fccb8a9567b5bdafb0f863ede.zip
Update vendor (whatsapp)
Diffstat (limited to 'vendor/modernc.org/libc/libc_openbsd.go')
-rw-r--r--vendor/modernc.org/libc/libc_openbsd.go28
1 files changed, 27 insertions, 1 deletions
diff --git a/vendor/modernc.org/libc/libc_openbsd.go b/vendor/modernc.org/libc/libc_openbsd.go
index 2e941341..0ad1a38c 100644
--- a/vendor/modernc.org/libc/libc_openbsd.go
+++ b/vendor/modernc.org/libc/libc_openbsd.go
@@ -1481,7 +1481,7 @@ func X__xuname(t *TLS, namesize int32, namebuf uintptr) int32 {
}
// int chflags(const char *path, u_int flags);
-func Xchflags(t *TLS, path uintptr, flags uint64) int32 {
+func Xchflags(t *TLS, path uintptr, flags uint32) int32 {
if err := unix.Chflags(GoString(path), int(flags)); err != nil {
if dmesgs {
dmesg("%v: %v FAIL", origin(1), err)
@@ -1605,3 +1605,29 @@ func X__assert2(t *TLS, file uintptr, line int32, fn, expr uintptr) {
func Xgetpagesize(t *TLS) int32 {
return int32(unix.Getpagesize())
}
+
+const PTHREAD_MUTEX_DEFAULT = 0
+
+// The pthread_mutex_init() function shall initialize the mutex referenced by
+// mutex with attributes specified by attr. If attr is NULL, the default mutex
+// attributes are used; the effect shall be the same as passing the address of
+// a default mutex attributes object. Upon successful initialization, the state
+// of the mutex becomes initialized and unlocked.
+//
+// If successful, the pthread_mutex_destroy() and pthread_mutex_init()
+// functions shall return zero; otherwise, an error number shall be returned to
+// indicate the error.
+//
+// int pthread_mutex_init(pthread_mutex_t *restrict mutex, const pthread_mutexattr_t *restrict attr);
+func Xpthread_mutex_init(t *TLS, pMutex, pAttr uintptr) int32 {
+ typ := PTHREAD_MUTEX_DEFAULT
+ if pAttr != 0 {
+ typ = int(X__ccgo_pthreadMutexattrGettype(t, pAttr))
+ }
+ mutexesMu.Lock()
+
+ defer mutexesMu.Unlock()
+
+ mutexes[pMutex] = newMutex(typ)
+ return 0
+}