Unison Help
![](https://rowebots.com/wp-content/plugins/documentor/skins/default/images/search.png)
- Unison Kernel
- Pthreads
- pthread_create()
- pthread_exit()
- pthread_self()
- pthread_equal()
- pthread_join()
- pthread_detach()
- pthread_setschedparam()
- pthread_getschedparam()
- pthread_attr_init()
- pthread_attr_destroy()
- pthread_attr_setstackaddr()
- pthread_attr_getstackaddr()
- pthread_attr_setstacksize()
- pthread_attr_getstacksize()
- pthread_attr_setschedparam()
- pthread_attr_getschedparam()
- pthread_attr_setdetachstate()
- pthread_attr_getdetachstate()
- pthread_stackinfo()
- pthread_setprio()
- pthread_getprio()
- sched_get_priority_max()
- sched_get_priority_min()
- sched_yield()
- Pthread Cancellation
- Mutex
- Semaphores
- Message Queues
- Conditional Variables
- Barriers
- Timers
- Clocks
- Memory Allocation
- Rendezvous
- Interrupts
- Directory Services
- Miscellaneous
- Pthreads
- Unison I/O Library
- Unison STDIO Library
- STDIO Library Calls
- clearerr()
- dprintf()
- fclose()
- fdopen()
- feof()
- ferror()
- fileno()
- fflush()
- fgetc()
- fgetpos()
- fgets()
- fopen()
- fprintf()
- fputc()
- fputs()
- fread()
- freopen()
- fscanf()
- fseek()
- fseeko()
- fsetpos()
- ftell()
- ftello()
- fwrite()
- getc()
- getc_unlocked()
- getchar()
- getchar_unlocked()
- getdelim()
- getline()
- gets()
- get_stderr_ptr()
- get_stdin_ptr()
- get_stdout_ptr()
- noperprintf()
- perprintf()
- perror()
- posix_compat()
- printf()
- putc()
- putc_unlocked()
- putchar()
- putchar_unlocked()
- puts()
- remove()
- rewind()
- scanf()
- setbuf()
- setvbuf()
- snprintf()
- sprintf()
- sscanf()
- stderr_init()
- stderr_close()
- stdin_init()
- stdin_close()
- stdout_init()
- stdout_close()
- vdprintf()
- vscanf()
- vsscanf()
- vfscanf()
- vprintf()
- vsnprintf()
- vsprintf()
- vfprintf()
- ungetc()
- Do-nothing Stubs
- STDIO Library Calls
- Unison LIBC Library
- Unison I/O Servers
- Graphics, Camera, Video, Audio
- Network Protocols
- TCP and UDP Server - tcpd
- DHCP Client Service - dhcp client
- DHCP Server - dhcpd
- Telnet Server - telnetd
- Tiny FTP Server - tftpd
- Point to Point - pppd
- Network Translation - NAT with PAT
- Firewall
- Tiny HTTP Server - thttpd
- Tiny HTTP Server with TLS
- POP3 Server
- Simple Mail Transfer Protocol Services (SMTP)
- Bootp Protocol
- File Transfer Protocol Server (FTP)
- File Transfer Client Services
- RPC / XDR
- DNS Client
- HTTP/HTTPS Client
- REST Client
- AutoIP Service - autoip client
- mDNS server - mdnsd
- SNTP Client
- SNMP Agent - Snmpd server
- SSL/TLS library
- SSH server
- IP security
- Power Control
- Serial I/O
- System Services
- Universal Serial Bus (USB)
- Wireless
- Remedy Tools for Unison
3.1.34.get_stdout_ptr() #
NAME
stdin_init – open stdin standart stream file
stdin_close – close stdin standart stream file
get_stdin_ptr – get current stdin standart stream file pointer
stdout_init – open stdout standart stream file
stdout_close – close stdout standart stream file
get_stdout_ptr – get current stdout standart stream file pointer
stderr_init – open stderr standart stream file
stderr_close – close stderr standart stream file
get_stderr_ptr – get current stderr standart stream file pointer
SYNOPSIS
#include <stdio.h>
FILE *stdin_init(char *fildes);
FILE *get_stdin_ptr(void);
void stdin_close(void);
FILE *stdout_init(char *fildes);
FILE *get_stdout_ptr(void);
void stdout_close(void);
FILE *stderr_init(char *fildes);
FILE *get_stderr_ptr(void);
void stderr_close(void);
DESCRIPTION
A file with associated buffering is called a stream and is declared to be a pointer to a defined type FILE. The fopen() function creates certain descriptive data for a stream and return a pointer to designate the stream in all further transactions.
Normally, on a standard LINUX/UNIX system, there are three open streams with constant pointers declared in the <stdio.h> header and associated with the standard open files.
Under Unison, these predefined streams are platform specific and implemented (or not) by the target hardware. As such, these streams require definition. These functions are provided (normally, for use with the user defined posix_compat function pair) to allow STDIO library functions such as printf(), perror() and application code using them to operate as expected.
RETURN VALUES
On success functions return a pointer to the opened stream file; otherwise, null.
ERRORS
No errors are defined.
EXAMPLE
int posix_compat(char *cwd, char *stdinServerName, char *stdoutServerName, char *stderrServerName) { /* any other init functions */ stdin_init (stdinServerName); stdout_init (stdoutServerName); stderr_init (stderrServerName); /* any other init functions */ return 1; } int end_posix_compat() { stderr_close(); stdout_close(); stdin_close(); return 1; } void main () { /* any other init functions */ posix_compat("", "/dev/ttyS1", "/dev/ttyS1", "/dev/ttyS1"); /* any other functions */ // close stdin, stdout stream files end_posix_compat(); }