RTEMS: types and constants that differ from the RTEMS headers

Open
#5,663 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
rust
Domain
backend

Research direction

Start with the RTEMS 6 headers and the linked downstream CI log, then inspect the RTEMS-specific definitions and ctest configuration linked from the issue. Compare the listed types, constants, functions and missing declarations against those headers, including the related dirfd and st_atime build failures. Done means the reported ABI mismatches and missing APIs are addressed and the RTEMS checks pass.

Written by the indexing model from the issue text.

Description

A ctest run against the RTEMS 6 headers on armv7-rtems-eabihf (the downstream CI from #5209, log) finds the differences below. The definitions involved are the same in RTEMS 7 (newlib 7d4336cf), except for the last item, which I only checked on RTEMS 6.

  • dirent has no d_off, d_reclen or d_namlen, so d_name is at 9 instead of 22, and std's read_dir hands readdir_r 272 bytes for a 280-byte struct
  • Size or alignment of pthread_attr_t, pthread_cond_t, pthread_condattr_t, pthread_mutex_t, pthread_rwlockattr_t, sem_t and cpu_set_t
  • sigaction starts with sa_flags on RTEMS
  • termios has no c_line, but has c_ispeed and c_ospeed
  • uid_t and gid_t are unsigned short as on espidf, horizon and vita, which also shifts stat, passwd and group
  • FNM_NOESCAPE is 1 and FNM_PATHNAME is 2
  • CLOCK_BOOTTIME is 7, not 4 (CLOCK_MONOTONIC)
  • rusage only has ru_utime and ru_stime, utsname has 48-byte fields and no domainname, and stat has no st_spare4
  • __errno does not exist, errno is thread-local
  • aligned_alloc resolves to newlib's, which needs the missing _memalign_r, because libc's -lc comes before -qrtems
  • 36 functions, 22 constants, loff_t, Dl_info and rlimit that RTEMS does not declare or implement (the FIXME(rtems) skips in the ctest config)

libc also lacks msghdr, cmsghdr and 129 of the names in unix.txt for RTEMS, e.g. the termios constants, F_OK and mprotect.

Not listed above because they break the std build rather than show up in ctest: #5655 (dirfd) and rust-lang/rust#164719 (st_atime), which is why the CI uses nightly-2026-10-19.

Dominant language
Rust
Stars
2.6k
Forks
1.3k
Avg merge
2d 13h
Merged PRs (30d)
27

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rust-lang/libc

All issues in rust-lang/libc

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.