C standard library :: stropts

ioctl - kontrol på STREAMS device

[XSR] [Option Start]int ioctl (int fd, unsigned long int request, ../* arg */..)[Option End]

Denne funktion udfører en mængde kontrol funktioner på STREAMS devices. For non-STREAM devices er kald til funktionen uvist. Parameteren request og en optionel tredie parameter (med forskellige typer) skal medtages og fortolkes af den tilhørende del af den STREAM associeret med fd.

Parameteren fd er en åben file descriptor som refererer til en device.

Parameteret request udvælger en kontrolfunktion at udføre og skal afhænge af den STREAMS der adresseres.

Parameteren arg præsenterer ekstra informationer som behøves af denne specifikke STREAMS device i at udføre den ønskede kontrolfunktion. Typen af arg afhænger af den bestemte kontrolforespørgsel, men den skal enten være et heltal eller en peger til en af device'n afhængig datastruktur.

Kommandoer med ioctl() til STREAMS, deres parametre og fejl muligheder til hver enkelt kommando er beskrevet nedenstående.

Følgende ioctl() kommandoer med fejlværdier vist er gældende for alle STREAMS filer:

I_PUSH
Skubber ind modulet hvis navn er udpeget af arg på toppen af den aktuelle STREAM lige under STREAM head. Den kalder derefter funktionen open() til det nye indskubbede modul.

Funktionen ioctl() med I_PUSH kommandoen vil fejle hvis:

[EINVAL]
Invalid modul navn.
[ENXIO]
Open funktionen til det nye modul fejlede.
[ENXIO]
Afbrydelse modtaget på fd.
I_POP
Skubber ud modulet lige under STREAM head udpeget af fd. Parameteren arg skal være 0.

Funktionen ioctl() med I_POP kommandoen vil fejle hvis:

[EINVAL]
Der er ikke noget modul i STREAM.
[ENXIO]
Afbrydelse modtaget på fd.
I_LOOK
Henter navnet på modulet lige under STREAM head på den STREAM udpeget af fd og placerer det i en streng udpeget af arg. Bufferen udpeget af arg bør være mindst FMNAMESZ+1 bytes lang, hvor FMNAMESZ er defineret i <stropts.h>.

Funktionen ioctl() med I_LOOK kommandoen vil fejle hvis:

[EINVAL]
Der er ikke noget modul i STREAM.
I_FLUSH
Nulstiller læse og/eller skrive køer afhængig af værdien på arg. Korrekte værdier af arg er:
FLUSHR
Nulstil alle læse køer.
FLUSHW
Nulstil alle skrive køer.
FLUSHRW
Nulstil alle læse og skrive køer.

Funktionen ioctl() med I_FLUSH kommandoen vil fejle hvis:

[EINVAL]
Invalid arg værdi.
[EAGAIN] eller [ENOSR]
Kan ikke allokere buffere for flush-message.
[ENXIO]
Afbrydelse modtaget på fd.
I_FLUSHBAND
Nulstiller et bestemt band af messages. Parameteren arg peger på en bandinfo struktur. Medlemmet bi_flag kan være en af FLUSHR, FLUSHW eller FLUSHRW. Medlemmet bi_pri bestemmer prioritets-band der skal nulstilles.
I_SETSIG
Beder til at STREAMS sender SIGPOLL signalet til den kaldende process når en bestemt hændelse indtræder på den STREAM associeret med fd. I_SETSIG supporterer en asynkron behandlings metode i STREAMS. Værdien af arg er en bitmaske som anviger hændelsen for hvilken processen skal signaleres. Det er en bitmaske der med OR kan kombineres af følgende konstanter:
S_RDNORM
En normal (prioritetsband sat til 0) message er ankommet til starten af en STREAM head læse kø. Et signal skal genereres selvom message er nul i længden.
S_RDBAND
En message med ikke-nul prioritet er ankommet til starten af en STREAM head læse kø. Et signal skal genereres selvom message er nul i længden.
S_INPUT
En message, der ikke er højprioriteret, er ankommet til starten af en STREAM head læse kø. Et signal skal genereres selvom message er nul i længden.
S_HIPRI
En højt prioriteret message er ankommet til starten af en STREAM head læse kø. Et signal skal genereres selvom message er nul i længden.
S_OUTPUT
Skrive køen for normal data (prioritetsband 0) lige under en STREAM head er ikke længere fuld. Det anviser for processen, at der er plads i køen for at sende (eller skrive) normal data downstream.
S_WRNORM
Se S_OUTPUT.
S_WRBAND
Skrive køen for en ikke-nul prioritetsband lige under en STREAM head er ikke længere fuld. Det anviser for processen, at der er plads i køen for at sende (eller skrive) prioriterede data downstream.
S_MSG
Et STREAM signal message som indeholder SIGPOLL signalet er nået forrest i STREAM head læse køen.
S_ERROR
Anmeldelsen af en fejl tilstand er nået til STREAM head.
S_HANGUP
Anmeldelsen af en afbrydelse er nået til STREAM head.
S_BANDURG
Når den bruges i forbindelse med S_RDBAND, SIGURG er genereret i stedet for SIGPOLL når en prioriteret message når forrest i STREAM head læse køen.

Hvis arg er 0 skal den kalende process afmeldes og skal ikke modtage flere SIGPOLL signaler for den stream associeret med fd.

Processer som ønsker at modtage SIGPOLL signaler skal sikre at de klart tilmeldes til at modtage dem ved brug af I_SETSIG. Hvis flere processer tilmeldet for at modtage dette signal for den samme hændelse på den samme STREAM, vil hver process blive signaleret når hændelsen optræder.

Funktionen ioctl() med I_SETSIG kommandoen vil fejle hvis:

[EINVAL]
Invalid arg værdi.
[EINVAL]
Værdien af arg er o og den kalende process er ikke anmeldt til at modtage SIGPOLL signalet.
[EAGAIN]
Der er utilstrækkelige ressourcer til at gemme signal forespørgslen.
I_GETSIG
Returnerer den hændelse for hvilken den kalende process fornærværende er anmeldt til få sendt et SIGPOLL signal. Hændelsen er returneret som en bitmaske i en int udpeget af arg, hvor hændelsen er af de specificeret i beskrivelsen til I_SETSIG ovenfor.

Funktionen ioctl() med I_GETSIG kommandoen vil fejle hvis:

[EINVAL]
Processen er ikke anmeldt til at modtage SIGPOLL signalet.
I_FIND
Sammenligner navnene af alle moduler aktuelt tilstede i STREAM med navnet udpeget af arg og returnerer 1 hvis modulnavnet er tilstede eller 0 hvis det ikke findes.

Funktionen ioctl() med I_FIND kommandoen vil fejle hvis:

[EINVAL]
arg har ikke et valid modulnavn.
I_PEEK
Modtager informationer i den første message på STREAM head læse køen uden at tage den message af køen. Den er analog til getmsg() bort set fra at denne kommando ikke fjerner message fra køen. Parameteren arg peger på en strpeek struktur.

Det er applikationen der skal sikre at maxlen, medlem i strukturen strbuf som findes i to medlemmer ctlbuf og databuf, er sat til antallet af bytes som kontrollerer informationen og/eller data information der modtages. Medlemmet flags kan markere RS_HIPRI eller 0 som beskrevet af getmsg(). Hvis processen sætter flags til RS_HIPRI, for eksempel, vil I_PEEK kun søge efter højt prioriterede message på STREAM head læse kø.

I_PEEK returnerer 1 hvis en message blev modtaget og 0 hvis ingen message blev fundet på STREAM head læse køen, eller hvis RS_HIPRI flaget var sat i flags og der ikke var nogen højt prioriterede message på STREAM head læse køen. Den venter ikke efter en message skal ankomme. Efter udførelse, vil ctlbuf angive information i kontrolbufferen og databuf angive informationer i data bufferen og flags indeholder værdien RS_HIPRI eller 0.

I_SRDOPT
Sætter read mode ved brug af værdier i parameteren arg. Read modes er beskrevet i read(). Flags i arg kan være:
RNORM
Byte-stream mode, standard.
RMSGD
Message-discard mode.
RMSGN
Message-nondiscard mode.

Bitmønsteret med OR af RMSGD og RMSGN skal returnere [EINVAL]. Bitmønsteret med OR af RNORM og enter RMSGD eller RMSGN skal resultere i andre flag overskriver RNORM hvilket er standard.

I tillæg behandlingen af kontrol messages af STREAM head kan ændres ved at sætte en af følgende flag i arg:

RPROTNORM
Lad read() fejle med [EBADMSG] hvis en message indeholder en kontrol del der er i front af STREAM head læse køen.
RPROTDAT
Levér en kontrol del af en message som data når en process kalder en read().
RPROTDIS
Fjern kontrol delen af en message og levér data delen når en process kalder en read().

Funktionen ioctl() med I_SRDOPT kommandoen vil fejle hvis:

[EINVAL]
Invalid arg værdi.
I_GRDOPT
Returnerer aktuel read mode indstilling, som beskrevet overfor, i en int peger i parameteren arg. Read modes er beskrevet i read().
I_NREAD
Tæller antallet af byte i data delen på den første message i STREAM head læse køen og placerer værdien i en int peger i parameteren arg. Returværdien for kommandoen skal være antallet af message i STREAM head læse køen. For eksempel, hvis 0 er returneret til arg, medens ioctl() returværdien er større end 0, betyder der at en nul-længde message er næst i køen.
I_FDINSERT
Kreerer en message fra specificeret buffer(e), tillægger information om en anden STREAM, og sender den message downstream. Denne message indeholder en kontrol del og en valgfri data del. Data og kontrol delen der skal sendes er adskildt gennem placering i seperate buffere som beskrevet nedenstående. Parameteren arg peger på strfdinsert strukturen.

Applikationen skal sikre at len, medlem i strukturen strbuf som findes i to medlemmer ctlbuf og databuf, er sat til størrelsen af en t_uscalar_t plus antallet af bytes af kontrol informationer der skal sendes med denne message. Medlemmet fildes angiver file descriptor på den anden STREAM og medlemmet offset skal have et passende forhold for brugen af en t_uscalar_t, specificerer offsettet fra starten af kontrolbufferen hvor I_FDINSERT skal gemme en t_uscalar_t hvis tolkning er specifik til STREAM enden. Applikationen skal sikre at len medlemmet i databuf strbuf strukturen er sat til antallet af bytes af data information der skal sendes med message eller til 0 hvis ingen data del skal sendes.

Medlemmet flags angiver typen af message der skal dannes. En normal message kreeres hvis flags er sat til 0 og en højpriotiteres message er kreeret hvis flags er sat til RS_HIPRI. For ikke-priotets messages, I_FDINSERT vil blokere hvis STREAM skrive køen er fuld. For prioriterede message, blokkerer I_FDINSERT ikke ved sådanne omstændigheder. For ikke-priotets messages, I_FDINSERT vil blokere ikke hvis STREAM skrive køen er fuld og O_NONBLOCK er sat. Derimod fejler kommandoen og sætter errno til [EAGAIN].

I_FDINSERT blokkerer også, med mindre det forhindres som udslag på mangel af ressourcer, ventende på tilgængeligheden af message blokke i STREAM uanset prioritet eller om O_NONBLOCK er angivet. Ingen message del er sendt.

Funktionen ioctl() med I_FDINSERT kommandoen vil fejle hvis:

[EAGAIN]
En ikke-prioriteret message er specificeret, O_NONBLOCK flaget er sat og STREAM skrive køen er fuld grundet interne flowkontrol omstændigheder.
[EAGAIN] eller [ENOSR]
Buffere kan ikke allokeres for message som skal kreeres.
[EINVAL]
En af følgende:
  • Medlemmet fd i strfdinsert strukturen er ikke valid åben STREAM file descriptor.
  • Størrelsen af en t_uscalar_t plus offset er større en len medlemmet for den buffer specificeret af ctlbuf.
  • Medlemmet offset angiver ikke en korrekt tilpasset lokation i data bufferen.
  • En udefineret værdi er gemt i flags.
[ENXIO]
Hangup received on the STREAM identified by either the fildes argument or the fildes member of the strfdinsert structure.
[ERANGE]
The len member for the buffer specified through databuf does not fall within the range specified by the maximum and minimum packet sizes of the topmost STREAM module; or the len member for the buffer specified through databuf is larger than the maximum configured size of the data part of a message; or the len member for the buffer specified through ctlbuf is larger than the maximum configured size of the control part of a message.
I_STR
Constructs an internal STREAMS ioctl() message from the data pointed to by arg, and sends that message downstream.

This mechanism is provided to send ioctl() requests to downstream modules and drivers. It allows information to be sent with ioctl(), and returns to the process any information sent upstream by the downstream recipient. I_STR shall block until the system responds with either a positive or negative acknowledgement message, or until the request times out after some period of time. If the request times out, it shall fail with errno set to [ETIME].

At most, one I_STR can be active on a STREAM. Further I_STR calls shall block until the active I_STR completes at the STREAM head. The default timeout interval for these requests is 15 seconds. The O_NONBLOCK flag has no effect on this call.

To send requests downstream, the application shall ensure that arg points to a strioctl structure.

The ic_cmd member is the internal ioctl() command intended for a downstream module or driver and ic_timout is the number of seconds (-1=infinite, 0=use implementation-defined timeout interval, >0=as specified) an I_STR request shall wait for acknowledgement before timing out. ic_len is the number of bytes in the data argument, and ic_dp is a pointer to the data argument. The ic_len member has two uses: on input, it contains the length of the data argument passed in, and on return from the command, it contains the number of bytes being returned to the process (the buffer pointed to by ic_dp should be large enough to contain the maximum amount of data that any module or the driver in the STREAM can return).

The STREAM head shall convert the information pointed to by the strioctl structure to an internal ioctl() command message and send it downstream.

The ioctl() function with the I_STR command shall fail if:

[EAGAIN] or [ENOSR]
Unable to allocate buffers for the ioctl() message.
[EINVAL]
The ic_len member is less than 0 or larger than the maximum configured size of the data part of a message, or ic_timout is less than -1.
[ENXIO]
Hangup received on fildes.
[ETIME]
A downstream ioctl() timed out before acknowledgement was received.

An I_STR can also fail while waiting for an acknowledgement if a message indicating an error or a hangup is received at the STREAM head. In addition, an error code can be returned in the positive or negative acknowledgement message, in the event the ioctl() command sent downstream fails. For these cases, I_STR shall fail with errno set to the value in the message.

I_SWROPT
Sets the write mode using the value of the argument arg. Valid bit settings for arg are:
SNDZERO
Send a zero-length message downstream when a write() of 0 bytes occurs. To not send a zero-length message when a write() of 0 bytes occurs, the application shall ensure that this bit is not set in arg (for example, arg would be set to 0).

The ioctl() function with the I_SWROPT command shall fail if:

[EINVAL]
arg is not the above value.
I_GWROPT
Returns the current write mode setting, as described above, in the int that is pointed to by the argument arg.
I_SENDFD
Creates a new reference to the open file description associated with the file descriptor arg, and writes a message on the STREAMS-based pipe fildes containing this reference, together with the user ID and group ID of the calling process.

The ioctl() function with the I_SENDFD command shall fail if:

[EAGAIN]
The sending STREAM is unable to allocate a message block to contain the file pointer; or the read queue of the receiving STREAM head is full and cannot accept the message sent by I_SENDFD.
[EBADF]
The arg argument is not a valid, open file descriptor.
[EINVAL]
The fildes argument is not connected to a STREAM pipe.
[ENXIO]
Hangup received on fildes.
I_RECVFD
Retrieves the reference to an open file description from a message written to a STREAMS-based pipe using the I_SENDFD command, and allocates a new file descriptor in the calling process that refers to this open file description. The arg argument is a pointer to a strrecvfd data structure as defined in <stropts.h>.

The fd member is a file descriptor. The uid and gid members are the effective user ID and effective group ID, respectively, of the sending process.

If O_NONBLOCK is not set, I_RECVFD shall block until a message is present at the STREAM head. If O_NONBLOCK is set, I_RECVFD shall fail with errno set to [EAGAIN] if no message is present at the STREAM head.

If the message at the STREAM head is a message sent by an I_SENDFD, a new file descriptor shall be allocated for the open file descriptor referenced in the message. The new file descriptor is placed in the fd member of the strrecvfd structure pointed to by arg.

The ioctl() function with the I_RECVFD command shall fail if:

[EAGAIN]
A message is not present at the STREAM head read queue and the O_NONBLOCK flag is set.
[EBADMSG]
The message at the STREAM head read queue is not a message containing a passed file descriptor.
[EMFILE]
The process has the maximum number of file descriptors currently open that it is allowed.
[ENXIO]
Hangup received on fildes.
I_LIST
Allows the process to list all the module names on the STREAM, up to and including the topmost driver name. If arg is a null pointer, the return value shall be the number of modules, including the driver, that are on the STREAM pointed to by fildes. This lets the process allocate enough space for the module names. Otherwise, it should point to a str_list structure.

The sl_nmods member indicates the number of entries the process has allocated in the array. Upon return, the sl_modlist member of the str_list structure shall contain the list of module names, and the number of entries that have been filled into the sl_modlist array is found in the sl_nmods member (the number includes the number of modules including the driver). The return value from ioctl() shall be 0. The entries are filled in starting at the top of the STREAM and continuing downstream until either the end of the STREAM is reached, or the number of requested modules ( sl_nmods) is satisfied.

The ioctl() function with the I_LIST command shall fail if:

[EINVAL]
The sl_nmods member is less than 1.
[EAGAIN] or [ENOSR]
Unable to allocate buffers.
I_ATMARK
Allows the process to see if the message at the head of the STREAM head read queue is marked by some module downstream. The arg argument determines how the checking is done when there may be multiple marked messages on the STREAM head read queue. It may take on the following values:
ANYMARK
Check if the message is marked.
LASTMARK
Check if the message is the last one marked on the queue.

The bitwise-inclusive OR of the flags ANYMARK and LASTMARK is permitted.

The return value shall be 1 if the mark condition is satisfied; otherwise, the value shall be 0.

The ioctl() function with the I_ATMARK command shall fail if:

[EINVAL]
Invalid arg value.
I_CKBAND
Checks if the message of a given priority band exists on the STREAM head read queue. This shall return 1 if a message of the given priority exists, 0 if no such message exists, or -1 on error. arg should be of type int.

The ioctl() function with the I_CKBAND command shall fail if:

[EINVAL]
Invalid arg value.
I_GETBAND
Returns the priority band of the first message on the STREAM head read queue in the integer referenced by arg.

The ioctl() function with the I_GETBAND command shall fail if:

[ENODATA]
No message on the STREAM head read queue.
I_CANPUT
Checks if a certain band is writable. arg is set to the priority band in question. The return value shall be 0 if the band is flow-controlled, 1 if the band is writable, or -1 on error.

The ioctl() function with the I_CANPUT command shall fail if:

[EINVAL]
Invalid arg value.
I_SETCLTIME
This request allows the process to set the time the STREAM head shall delay when a STREAM is closing and there is data on the write queues. Before closing each module or driver, if there is data on its write queue, the STREAM head shall delay for the specified amount of time to allow the data to drain. If, after the delay, data is still present, it shall be flushed. The arg argument is a pointer to an integer specifying the number of milliseconds to delay, rounded up to the nearest valid value. If I_SETCLTIME is not performed on a STREAM, an implementation-defined default timeout interval is used.

The ioctl() function with the I_SETCLTIME command shall fail if:

[EINVAL]
Invalid arg value.
I_GETCLTIME
Returns the close time delay in the integer pointed to by arg.
Multiplexed STREAMS Configurations

The following commands are used for connecting and disconnecting multiplexed STREAMS configurations. These commands use an implementation-defined default timeout interval.

I_LINK
Connects two STREAMs, where fildes is the file descriptor of the STREAM connected to the multiplexing driver, and arg is the file descriptor of the STREAM connected to another driver. The STREAM designated by arg is connected below the multiplexing driver. I_LINK requires the multiplexing driver to send an acknowledgement message to the STREAM head regarding the connection. This call shall return a multiplexer ID number (an identifier used to disconnect the multiplexer; see I_UNLINK) on success, and -1 on failure.

The ioctl() function with the I_LINK command shall fail if:

[ENXIO]
Hangup received on fildes.
[ETIME]
Timeout before acknowledgement message was received at STREAM head.
[EAGAIN] or [ENOSR]
Unable to allocate STREAMS storage to perform the I_LINK.
[EBADF]
The arg argument is not a valid, open file descriptor.
[EINVAL]
The fildes argument does not support multiplexing; or arg is not a STREAM or is already connected downstream from a multiplexer; or the specified I_LINK operation would connect the STREAM head in more than one place in the multiplexed STREAM.

An I_LINK can also fail while waiting for the multiplexing driver to acknowledge the request, if a message indicating an error or a hangup is received at the STREAM head of fildes. In addition, an error code can be returned in the positive or negative acknowledgement message. For these cases, I_LINK fails with errno set to the value in the message.

I_UNLINK
Disconnects the two STREAMs specified by fildes and arg. fildes is the file descriptor of the STREAM connected to the multiplexing driver. The arg argument is the multiplexer ID number that was returned by the I_LINK ioctl() command when a STREAM was connected downstream from the multiplexing driver. If arg is MUXID_ALL, then all STREAMs that were connected to fildes shall be disconnected. As in I_LINK, this command requires acknowledgement.

The ioctl() function with the I_UNLINK command shall fail if:

[ENXIO]
Hangup received on fildes.
[ETIME]
Timeout before acknowledgement message was received at STREAM head.
[EAGAIN] or [ENOSR]
Unable to allocate buffers for the acknowledgement message.
[EINVAL]
Invalid multiplexer ID number.

An I_UNLINK can also fail while waiting for the multiplexing driver to acknowledge the request if a message indicating an error or a hangup is received at the STREAM head of fildes. In addition, an error code can be returned in the positive or negative acknowledgement message. For these cases, I_UNLINK shall fail with errno set to the value in the message.

I_PLINK
Creates a persistent connection between two STREAMs, where fildes is the file descriptor of the STREAM connected to the multiplexing driver, and arg is the file descriptor of the STREAM connected to another driver. This call shall create a persistent connection which can exist even if the file descriptor fildes associated with the upper STREAM to the multiplexing driver is closed. The STREAM designated by arg gets connected via a persistent connection below the multiplexing driver. I_PLINK requires the multiplexing driver to send an acknowledgement message to the STREAM head. This call shall return a multiplexer ID number (an identifier that may be used to disconnect the multiplexer; see I_PUNLINK) on success, and -1 on failure.

The ioctl() function with the I_PLINK command shall fail if:

[ENXIO]
Hangup received on fildes.
[ETIME]
Timeout before acknowledgement message was received at STREAM head.
[EAGAIN] or [ENOSR]
Unable to allocate STREAMS storage to perform the I_PLINK.
[EBADF]
The arg argument is not a valid, open file descriptor.
[EINVAL]
The fildes argument does not support multiplexing; or arg is not a STREAM or is already connected downstream from a multiplexer; or the specified I_PLINK operation would connect the STREAM head in more than one place in the multiplexed STREAM.

An I_PLINK can also fail while waiting for the multiplexing driver to acknowledge the request, if a message indicating an error or a hangup is received at the STREAM head of fildes. In addition, an error code can be returned in the positive or negative acknowledgement message. For these cases, I_PLINK shall fail with errno set to the value in the message.

I_PUNLINK
Disconnects the two STREAMs specified by fildes and arg from a persistent connection. The fildes argument is the file descriptor of the STREAM connected to the multiplexing driver. The arg argument is the multiplexer ID number that was returned by the I_PLINK ioctl() command when a STREAM was connected downstream from the multiplexing driver. If arg is MUXID_ALL, then all STREAMs which are persistent connections to fildes shall be disconnected. As in I_PLINK, this command requires the multiplexing driver to acknowledge the request.

The ioctl() function with the I_PUNLINK command shall fail if:

[ENXIO]
Hangup received on fildes.
[ETIME]
Timeout before acknowledgement message was received at STREAM head.
[EAGAIN] or [ENOSR]
Unable to allocate buffers for the acknowledgement message.
[EINVAL]
Invalid multiplexer ID number.

An I_PUNLINK can also fail while waiting for the multiplexing driver to acknowledge the request if a message indicating an error or a hangup is received at the STREAM head of fildes. In addition, an error code can be returned in the positive or negative acknowledgement message. For these cases, I_PUNLINK shall fail with errno set to the value in the message.

RETURN VALUE

Upon successful completion, ioctl() shall return a value other than -1 that depends upon the STREAMS device control function. Otherwise, it shall return -1 and set errno to indicate the error.

ERRORS

Under the following general conditions, ioctl() shall fail if:

[EBADF]
The fildes argument is not a valid open file descriptor.
[EINTR]
A signal was caught during the ioctl() operation.
[EINVAL]
The STREAM or multiplexer referenced by fildes is linked (directly or indirectly) downstream from a multiplexer.

If an underlying device driver detects an error, then ioctl() shall fail if:

[EINVAL]
The request or arg argument is not valid for this device.
[EIO]
Some physical I/O error has occurred.
[ENOTTY]
The fildes argument is not associated with a STREAMS device that accepts control functions.
[ENXIO]
The request and arg arguments are valid for this device driver, but the service requested cannot be performed on this particular sub-device.
[ENODEV]
The fildes argument refers to a valid STREAMS device, but the corresponding device driver does not support the ioctl() function.

If a STREAM is connected downstream from a multiplexer, any ioctl() command except I_UNLINK and I_PUNLINK shall set errno to [EINVAL].


 

Return værdi

 

Fejl

 

Ressourcer C Library opslag The Single UNIX® Specification, Version 2 Copyright © 1997 The Open Group GNU C Library Engelsk, med masser af gode og dybe artikler. Danske søgeord Find selv de bedste danske søgeord til din hjemmeside.
Produkter Bookingsystem
System for reservation af tid for behandlinger, aftaler, lokaler, udstyr, personale. Tilpasset lektionstimer. Udskriver arbejdsplaner og ugeskema for opslag. Statistik. Danmarks bedste pris nu kun kr. 1.695,-
HelpdeskEffektiviser din support-organisation med et Helpdesksystem. Fjern tidrøvere der forhindrer fokus på problemløsning. Lektionsplan Formidling af generelle information og specifikke lektioner fra undervisere til studerende/elever. Medlemssystem Medlemssystem online med administration af medlemskartotek, kontingentbetalinger, flettefiler m.m.
Styr selv Styr selv indholdet på dine hjemmesider med Content Management System.
Citat Det er ikke fordi ting er vanskelige, vi ikke tør. Det er fordi, vi ikke tør, ting er vanskelige.

Seneca



Professionelle løsninger til Internettet. Webdesign, e-handel, cms, søgeoptimering, webhotel, analyse, Intranet mm.