Skip to content

Unistd mappings for every architecture #1

@CruzBishop

Description

@CruzBishop

This is a tracking issue for the status of linux-api/unistd.rs.

Why is this required?

Unistd.h mappings are required for a stable(!!) release of linux-api-sys and the implementation of the syscall function.

Why do you need the syscall function?

  • I will have the ability to remove all named bindings to system calls, and instead provide a safe wrapper. A small dependency on linux-api-sys isn't optimal, but it will make it easier for other developers
  • Some system calls, such as gettid() have no libc wrapper; They can't be called from Rust as-is. Instead, I will do something like the following:
pub fn get_current_thread_id() -> ::pid_t {
    unsafe {
        ::syscall(call_id: ::NR_gettid) as ::pid_t //TODO Check this to see if it works in production
    }
}

This will be able to be used without any unsafe blocks in regular code. Please note that it is just a prototype and has not actually been implemented yet, so it may change.

Tracking section

Implementations

  • asm_generic
  • alpha
  • arm
  • avr32
  • blackfin
  • cris
  • frv
  • ia64
  • m32r
  • m68k
  • microblaze
  • mips
  • m10300
  • parisc
  • powerpc
  • s390
  • sh (May be dropped)
  • sparc
  • x86
  • x86-64

Minor extensions to asm_generic

  • arc
  • c6x
  • metag
  • nios2
  • openrisc
  • tile

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions