Giter VIP home page Giter VIP logo

ioctl-rs's People

Contributors

dcuddeback avatar mneumann avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ioctl-rs's Issues

`ioctl` function signature is wrong

In C:

       #include <sys/ioctl.h>

       int ioctl(int d, unsigned long request, ...);

Library (at least inside os::linux):

extern "C" {
    pub fn ioctl(fd: c_int, request: c_int, ...) -> c_int;
}

I believe request should be a c_uint, otherwise ioctls >= 0x8000_0000 or higher will cause overflow warnings.

Wrapper functions are not completed

For example, from man tty_ioctl:

  Controlling terminal
       TIOCSCTTY int arg
              Make the given terminal the controlling terminal of the calling process.  The calling process must be a session leader and not have a controlling terminal already.  For this case, arg should be specified as zero.
              If this terminal is already the controlling terminal of a different session group, then the ioctl fails with EPERM, unless the caller has the CAP_SYS_ADMIN capability and arg equals 1, in  which  case  the  terminal  is
              stolen, and all processes that had it as controlling terminal lose it.
       TIOCNOTTY void
              If the given terminal was the controlling terminal of the calling process, give up this controlling terminal.  If the process was session leader, then send SIGHUP and SIGCONT to the foreground process group and all pro‐
              cesses in the current session lose their controlling terminal.
   Process group and session ID
       TIOCGPGRP pid_t *argp
              When successful, equivalent to *argp = tcgetpgrp(fd).
              Get the process group ID of the foreground process group on this terminal.
       TIOCSPGRP const pid_t *argp
              Equivalent to tcsetpgrp(fd, *argp).
              Set the foreground process group ID of this terminal.
       TIOCGSID  pid_t *argp
              Get the session ID of the given terminal.  This will fail with ENOTTY in case the terminal is not a master pseudoterminal and not our controlling terminal.  Strange.

tiocsctty(), tiocnotty(), tiocgpgrp(), etc. are missing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.