Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • K kernel
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 13
    • Issues 13
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • erlends-os
  • kernel
  • kernel
  • Wiki
    • Abi
  • ioctl_fcntl

Last edited by Erlend Sveen Oct 06, 2019
Page history

ioctl_fcntl

Perform a special file operation (fctnl) or IO control operation (ioctl). They are considered the same by the kernel (handled by the same code), however, using the correct function is recommended for portability.

Syntax

#include <fcntl.h>

int fctnl (int fd, int operation, ...);
#include <ioctl.h>

int ioctl (int fd, int operation, ...);

Parameters

  • fd

    The file descriptor to use.

  • operation

    The operation to perform, see below.

  • ...

    Optional extra argument. Only one extra argument is allowed/used.

Operation types

  • F_GETFL

    Get file flags.

  • F_SETFL

    Set file flags.

  • F_SETOWN

    Set file owner. Required by some drivers for signal delivery.

Return Value

The return value is null if successful. Otherwise, the return value is negative and errno is set:

  • EBADF

    Bad file descriptor.

Remarks

For driver operations, check the corresponding driver.

Clone repository
  • abi
    • bind
    • chdir
    • close
    • closedir
    • dup2
    • exit
    • fstat
    • getcwd
    • getpgrp
    • getpid
    • gettimeofday
    • ioctl_fcntl
    • kill
    • link
    • lseek
View All Pages