Skip to content
Snippets Groups Projects
Commit b9828bd8 authored by jD91mZM2's avatar jD91mZM2
Browse files

Merge branch 'elf_And_flock' into 'master'

Elf and flock

See merge request redox-os/relibc!283
parents d827c0f1 b5deadbe
No related branches found
No related tags found
1 merge request!283Elf and flock
Pipeline #8266 passed with warnings
#ifndef _BITS_ELF_H
#define _BITS_ELF_H
#define ELF32_ST_BIND(val) (((unsigned char) (val)) >> 4)
#define ELF32_ST_TYPE(val) ((val) & 0xf)
#define ELF32_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf))
#define ELF64_ST_BIND(val) ELF32_ST_BIND (val)
#define ELF64_ST_TYPE(val) ELF32_ST_TYPE (val)
#define ELF64_ST_INFO(bind, type) ELF32_ST_INFO ((bind), (type))
#define ELF32_ST_VISIBILITY(o) ((o) & 0x03)
#define ELF64_ST_VISIBILITY(o) ELF32_ST_VISIBILITY (o)
#define ELF32_R_SYM(val) ((val) >> 8)
#define ELF32_R_TYPE(val) ((val) & 0xff)
#define ELF32_R_INFO(sym, type) (((sym) << 8) + ((type) & 0xff))
#define ELF64_R_SYM(i) ((i) >> 32)
#define ELF64_R_TYPE(i) ((i) & 0xffffffff)
#define ELF64_R_INFO(sym,type) ((((Elf64_Xword) (sym)) << 32) + (type))
#define DT_VALRNGHI 0x6ffffdff
#define DT_VALTAGIDX(tag) (DT_VALRNGHI - (tag))
#define DT_ADDRRNGHI 0x6ffffeff
#define DT_ADDRTAGIDX(tag) (DT_ADDRRNGHI - (tag))
#define DT_VERNEEDNUM 0x6fffffff
#define DT_VERSIONTAGIDX(tag) (DT_VERNEEDNUM - (tag))
#define ELF32_M_SYM(info) ((info) >> 8)
#define ELF32_M_SIZE(info) ((unsigned char) (info))
#define ELF32_M_INFO(sym, size) (((sym) << 8) + (unsigned char) (size))
#define ELF64_M_SYM(info) ELF32_M_SYM (info)
#define ELF64_M_SIZE(info) ELF32_M_SIZE (info)
#define ELF64_M_INFO(sym, size) ELF32_M_INFO (sym, size)
#endif /* ifdef _BITS_ELF_H*/
sys_includes = ["bits/elf.h"]
include_guard = "_ELF_H"
language = "C"
style = "Tag"
no_includes = true
cpp_compat = true
[enum]
prefix_with_name = true
This diff is collapsed.
...@@ -32,7 +32,14 @@ pub const F_UNLCK: c_int = 2; ...@@ -32,7 +32,14 @@ pub const F_UNLCK: c_int = 2;
pub unsafe extern "C" fn creat(path: *const c_char, mode: mode_t) -> c_int { pub unsafe extern "C" fn creat(path: *const c_char, mode: mode_t) -> c_int {
sys_open(path, O_WRONLY | O_CREAT | O_TRUNC, mode) sys_open(path, O_WRONLY | O_CREAT | O_TRUNC, mode)
} }
#[repr(C)]
pub struct flock {
pub l_type: c_short,
pub l_whence: c_short,
pub l_start: off_t,
pub l_len: off_t,
pub l_pid: pid_t,
}
#[no_mangle] #[no_mangle]
pub extern "C" fn sys_fcntl(fildes: c_int, cmd: c_int, arg: c_int) -> c_int { pub extern "C" fn sys_fcntl(fildes: c_int, cmd: c_int, arg: c_int) -> c_int {
Sys::fcntl(fildes, cmd, arg) Sys::fcntl(fildes, cmd, arg)
...@@ -43,3 +50,6 @@ pub unsafe extern "C" fn sys_open(path: *const c_char, oflag: c_int, mode: mode_ ...@@ -43,3 +50,6 @@ pub unsafe extern "C" fn sys_open(path: *const c_char, oflag: c_int, mode: mode_
let path = CStr::from_ptr(path); let path = CStr::from_ptr(path);
Sys::open(path, oflag, mode) Sys::open(path, oflag, mode)
} }
#[no_mangle]
pub unsafe extern "C" fn cbindgen_stupid_struct_user_for_fcntl(a: flock) {}
...@@ -7,6 +7,7 @@ pub mod dirent; ...@@ -7,6 +7,7 @@ pub mod dirent;
#[path = "dl-tls/mod.rs"] #[path = "dl-tls/mod.rs"]
pub mod dl_tls; pub mod dl_tls;
pub mod dlfcn; pub mod dlfcn;
pub mod elf;
pub mod errno; pub mod errno;
pub mod fcntl; pub mod fcntl;
pub mod float; pub mod float;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment