Skip to content

Missing POSIX lockf #1631

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
brunoczim opened this issue Dec 30, 2019 · 0 comments · Fixed by #1708
Closed

Missing POSIX lockf #1631

brunoczim opened this issue Dec 30, 2019 · 0 comments · Fixed by #1708

Comments

@brunoczim
Copy link

brunoczim commented Dec 30, 2019

use libc;

fn main() {
    let name = b"foo" as *const u8 as *const i8;
    let file = libc::open(name, libc::O_WRONLY);
    libc::lockf(file, libc::F_TLOCK, 0);
    libc::lockf(file, libc::F_ULOCK, 0);
    libc::close(file);
}
  • the target triple - x86_64-unknown-linux-gnu
  • Try to compile the following code in the given target triple. The following error appears:
   Compiling playground v0.0.1 (/playground)
error[E0425]: cannot find function `lockf` in crate `libc`
 --> src/main.rs:6:11
  |
6 |     libc::lockf(file, libc::F_TLOCK, 0);
  |           ^^^^^ not found in `libc`

error[E0425]: cannot find function `lockf` in crate `libc`
 --> src/main.rs:7:11
  |
7 |     libc::lockf(file, libc::F_ULOCK, 0);
  |           ^^^^^ not found in `libc`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0425`.
error: could not compile `playground`.

To learn more, run the command again with --verbose.
pickfire added a commit to pickfire/libc that referenced this issue Mar 25, 2020
pickfire added a commit to pickfire/libc that referenced this issue Mar 25, 2020
@pickfire pickfire mentioned this issue Mar 25, 2020
pickfire added a commit to pickfire/libc that referenced this issue Mar 26, 2020
cpu pushed a commit to cpu/libc that referenced this issue Apr 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant