Commit Graph

20 Commits

Author SHA1 Message Date
auronandace 1191d8e1b4 extract timespec to a bits header 2026-02-12 13:07:24 +00:00
Wildan M 9789af36f0 Put timespec convert into common fn 2026-01-07 00:07:50 +07:00
Wildan M 242ed32b42 Implement pthread_cond_timedwait futex properly 2026-01-06 15:33:58 +07:00
auronandace 6e25b2be7f arpa_inet and semaphore header cleanup 2025-12-31 09:14:21 +00:00
Jeremy Soller 82084440ad Support nightly-2025-10-03 2025-10-03 21:51:10 -06:00
Wildan M 80ea3bc6a1 Add sem_clockwait and fix timedwait clock_id 2025-08-28 12:58:54 +07:00
4lDO2 6e5959b3fa Convert a bunch of c_int to Result<(), Errno>. 2024-09-26 16:21:34 +02:00
Noa df6f4678e8 Fix warnings 2023-05-30 13:46:17 -05:00
4lDO2 cdd0f67b23 Rustfmt. 2023-05-17 15:28:10 +02:00
4lDO2 9040c2a2a2 fix semaphores 2023-05-11 17:18:12 -06:00
Jeremy Soller 6516695519 Format 2022-12-16 17:39:30 -07:00
Jeremy Soller da4d277f12 Use futex again for semaphore 2022-12-01 14:05:12 -07:00
Jeremy Soller 9b04c2e5d3 Add missing imports 2022-12-01 10:50:27 -07:00
Jeremy Soller df75b8d037 Semaphore improvements 2022-12-01 10:48:53 -07:00
Jeremy Soller 16abc91341 cargo fmt and cargo fix 2022-11-11 13:27:18 -07:00
Jeremy Soller e7b6252bd3 Make semaphore always sched_yield 2022-09-01 15:43:11 -06:00
Jeremy Soller 53c8f0facd Simplify semaphore for debugging 2022-09-01 10:56:18 -06:00
Jeremy Soller 8576b99759 Add timeout to futex_wait calls 2022-04-04 20:23:29 -06:00
Mateusz Tabaka a7480ea656 Fix global symbols relocations
Instead of a single source of symbols, now linker keeps a list of DSO (former Library) objects
with their own symbols map. That helps to process R_X86_64_COPY relocations correctly.
For example, if 'a.out' executable with dependencies ['libstdc++.so', 'libc.so'] is being loaded
and 'a.out' uses 'stdout' symbol from 'libc.so', its relocation process goes as follows:
- linker processes relocation entry 'stdout' of type R_X86_64_GLOB_DAT from 'libc.so',
- it goes through object list ['a.out', 'libstdc++.so', 'libc.so'] to find first object
  that exports 'stdout' symbol. The symbol is in 'a.out' with the value e.g. '0x404070',
- linker sets 'stdout' symbol GOT entry in 'libc.so' to '0x404070',
....
- linker processes relocation entry 'stdout' of type R_X86_64_COPY from 'a.out',
- it goes through object list excluding 'a.out': ['libstdc++.so', 'libc.so']. The symbol is found in 'libc.so',
- linker copies the 'stdout' symbol content from 'libc.so' to memory at address '0x404070' (in 'a.out' object).

Objects are relocated in reverse order they were loaded. So in the example above, linker starts with relocating
'libc.so' and ends with 'a.out'. It is necessary e.g. when linking with 'libstdc++.so' - there are many
relocations which symbols are found in 'libstdc++.so', so they need to be resolved before their contents are
copied to 'a.out'. That also matches GNU ld.so behavior.
2021-01-03 16:04:40 +01:00
Jeremy Soller 2f69f0e7f1 Add simple semaphore implementation using futex 2020-12-23 12:18:17 -07:00