Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A tiny library to send file descriptors across processes

License

NotificationsYou must be signed in to change notification settings

sharvil/flingfd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

flingfd is a small, standalone C library to pass file descriptors across processes on Linux.

Installation

By default, flingfd installs in/usr/local. If you want to change where it gets installed, edit thePREFIX in the Makefile.

  $ make && sudo make install

Documentation

The library consists of two functions declared inflingfd.h:

boolflingfd_simple_send(constchar*path,intfd);intflingfd_simple_recv(constchar*path);

When you want to send a file descriptor, callflingfd_simple_send and receive it in the other process withflingfd_simple_recv. Make sure you use the samepath argument in both processes -- that determines which process gets the file descriptor.

Here's an example of sendingstdout to another process:

#include<flingfd.h>voidsend_my_stdout() {intfd=fileno(stdout);flingfd_simple_send("/tmp/some_unique_path",fd);  }

And here's the other process writing to the sender'sstdout:

#include<flingfd.h>voidwrite_to_their_stdout() {intfd=flingfd_simple_recv("/tmp/some_unique_path");write(fd,"Hello world\n",12);  }

When you're done writing your code, link against the library with-lflingfd.

Bindings

License

Apache 2.0

About

A tiny library to send file descriptors across processes

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp