1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 02:47:35 +00:00

LibC: Partially implement pthread_setcancel{state,type}()

With those partially implemented I can start to clone the SerenityOS
git repository via HTTPS.

The download still fails half-way through because SSL_read returns
an error for reasons I haven't investigated yet.
This commit is contained in:
Gunnar Beutner 2021-05-10 15:13:59 +02:00 committed by Linus Groh
parent a14a1f2d61
commit 759acdb938
2 changed files with 17 additions and 4 deletions

View file

@ -555,14 +555,24 @@ int pthread_getname_np(pthread_t thread, char* buffer, size_t buffer_size)
__RETURN_PTHREAD_ERROR(rc);
}
int pthread_setcancelstate([[maybe_unused]] int state, [[maybe_unused]] int* oldstate)
int pthread_setcancelstate(int state, int* oldstate)
{
TODO();
if (oldstate)
*oldstate = PTHREAD_CANCEL_DISABLE;
dbgln("FIXME: Implement pthread_setcancelstate({}, ...)", state);
if (state != PTHREAD_CANCEL_DISABLE)
return EINVAL;
return 0;
}
int pthread_setcanceltype([[maybe_unused]] int type, [[maybe_unused]] int* oldtype)
int pthread_setcanceltype(int type, int* oldtype)
{
TODO();
if (oldtype)
*oldtype = PTHREAD_CANCEL_DEFERRED;
dbgln("FIXME: Implement pthread_setcanceltype({}, ...)", type);
if (type != PTHREAD_CANCEL_DEFERRED)
return EINVAL;
return 0;
}
constexpr static pid_t spinlock_unlock_sentinel = 0;