Sponsored Content
Full Discussion: unnamed pipes and threads
Top Forums Programming unnamed pipes and threads Post 302573863 by nimesh on Tuesday 15th of November 2011 11:36:54 PM
Old 11-16-2011
Thanks guys, exactly what I wanted!
 

10 More Discussions You Might Find Interesting

1. Filesystems, Disks and Memory

PIPEs and Named PIPEs (FIFO) Buffer size

Hello! How I can increase or decrease predefined pipe buffer size? System FreeBSD 4.9 and RedHat Linux 9.0 Thanks! (1 Reply)
Discussion started by: Jus
1 Replies

2. Shell Programming and Scripting

cd using pipes

Hi, Can the cd command be invoked using pipes??? My actual question is slightly different. I am trying to run an executable from different folders and the path of these folders are obtained dynamically from the front end. Is there a way in which i can actually run the executable... (2 Replies)
Discussion started by: Sinbad
2 Replies

3. Programming

pipes + structs

heya got a small problem here. im trying to pipe eg: 'ls | more'. i have created a command line parser which separates ls and more into two commands. i have also created a struct, each struct has a command name, number of arguments, redirect_in, redirect_out, pipe_in, etc etc.... eg: struct... (0 Replies)
Discussion started by: mile1982
0 Replies

4. Programming

pipes inside

Extremely need to understand some aspects of pipes realization. The main question is in which memory are pipes placed? (13 Replies)
Discussion started by: pranki
13 Replies

5. UNIX for Advanced & Expert Users

FIFO Pipes

Hi...Can anyone please guide me on FIFO Pipes in UNIX.I have lerant things like creating fifo pipes,using them for reads and writes etc.I want to know what is the maximum amount of memory that such a pipe may have? Also can anyone guide me on where to get info on this topic from? (4 Replies)
Discussion started by: tej.buch
4 Replies

6. UNIX for Advanced & Expert Users

Threads and Threads Count ?

Hi all, How can I get the list of all Threads and the Total count of threads under a particular process ? Do suggest !! Awaiting for the replies !! Thanks Varun:b: (2 Replies)
Discussion started by: varungupta
2 Replies

7. Shell Programming and Scripting

Pipes not working

Hi, thanks for b4. can anyone tell me why following not working: noUsers=$(who | cut -d" " -f1 | wc -l) What i'm trying to do is get a list of logged on users and pass it to 'wc -l' and store the output to a variable. Any ideas? (1 Reply)
Discussion started by: Furqan_79
1 Replies

8. Programming

Pipes in C

Hello all, I am trying to learn more about programming Unix pipes in C. I have created a pipe that does od -bc < myfile | head Now, I am trying to create od -bc < myfile | head | wc Here is my code, and I know I might be off, thats why I am here so I can get some clarification. #include... (1 Reply)
Discussion started by: petrca
1 Replies

9. Programming

Problem with pipes

problem solved. (1 Reply)
Discussion started by: superfons
1 Replies

10. Programming

Child threads communicating with main thread via pipes

I have a simple client/server program I am using for learning purposes. I have it setup so that after server is setup and listening it than goes into a loop where it accepts incoming client connections. After each connection, the client socket is than passed to a thread routine where it can be... (3 Replies)
Discussion started by: Majortom71
3 Replies
explain_pipe(3) 					     Library Functions Manual						   explain_pipe(3)

NAME
explain_pipe - explain pipe(2) errors SYNOPSIS
#include <libexplain/pipe.h> const char *explain_pipe(int *pipefd); const char *explain_errno_pipe(int errnum, int *pipefd); void explain_message_pipe(char *message, int message_size, int *pipefd); void explain_message_errno_pipe(char *message, int message_size, int errnum, int *pipefd); DESCRIPTION
These functions may be used to obtain explanations for errors returned by the pipe(2) system call. explain_pipe const char *explain_pipe(int *pipefd); The explain_pipe function is used to obtain an explanation of an error returned by the pipe(2) system call. The least the message will contain is the value of strerror(errno), but usually it will do much better, and indicate the underlying cause in more detail. The errno global variable will be used to obtain the error value to be decoded. This function is intended to be used in a fashion similar to the following example: if (pipe(pipefd) < 0) { fprintf(stderr, "%s ", explain_pipe(pipefd)); exit(EXIT_FAILURE); } The above code example is available pre-packaged as the explain_pipe_or_die(3) function. pipefd The original pipefd, exactly as passed to the pipe(2) system call. Returns: The message explaining the error. This message buffer is shared by all libexplain functions which do not supply a buffer in their argument list. This will be overwritten by the next call to any libexplain function which shares this buffer, including other threads. Note: This function is not thread safe, because it shares a return buffer across all threads, and many other functions in this library. explain_errno_pipe const char *explain_errno_pipe(int errnum, int *pipefd); The explain_errno_pipe function is used to obtain an explanation of an error returned by the pipe(2) system call. The least the message will contain is the value of strerror(errnum), but usually it will do much better, and indicate the underlying cause in more detail. This function is intended to be used in a fashion similar to the following example: if (pipe(pipefd) < 0) { int err = errno; fprintf(stderr, "%s ", explain_errno_pipe(err, pipefd)); exit(EXIT_FAILURE); } The above code example is available pre-packaged as the explain_pipe_or_die(3) function. errnum The error value to be decoded, usually obtained from the errno global variable just before this function is called. This is neces- sary if you need to call any code between the system call to be explained and this function, because many libc functions will alter the value of errno. pipefd The original pipefd, exactly as passed to the pipe(2) system call. Returns: The message explaining the error. This message buffer is shared by all libexplain functions which do not supply a buffer in their argument list. This will be overwritten by the next call to any libexplain function which shares this buffer, including other threads. Note: This function is not thread safe, because it shares a return buffer across all threads, and many other functions in this library. explain_message_pipe void explain_message_pipe(char *message, int message_size, int *pipefd); The explain_message_pipe function may be used to obtain an explanation of an error returned by the pipe(2) system call. The least the message will contain is the value of strerror(errno), but usually it will do much better, and indicate the underlying cause in more detail. The errno global variable will be used to obtain the error value to be decoded. This function is intended to be used in a fashion similar to the following example: if (pipe(pipefd) < 0) { char message[3000]; explain_message_pipe(message, sizeof(message), pipefd); fprintf(stderr, "%s ", message); exit(EXIT_FAILURE); } The above code example is available pre-packaged as the explain_pipe_or_die(3) function. message The location in which to store the returned message. If a suitable message return buffer is supplied, this function is thread safe. message_size The size in bytes of the location in which to store the returned message. pipefd The original pipefd, exactly as passed to the pipe(2) system call. explain_message_errno_pipe void explain_message_errno_pipe(char *message, int message_size, int errnum, int *pipefd); The explain_message_errno_pipe function may be used to obtain an explanation of an error returned by the pipe(2) system call. The least the message will contain is the value of strerror(errnum), but usually it will do much better, and indicate the underlying cause in more detail. This function is intended to be used in a fashion similar to the following example: if (pipe(pipefd) < 0) { int err = errno; char message[3000]; explain_message_errno_pipe(message, sizeof(message), err, pipefd); fprintf(stderr, "%s ", message); exit(EXIT_FAILURE); } The above code example is available pre-packaged as the explain_pipe_or_die(3) function. message The location in which to store the returned message. If a suitable message return buffer is supplied, this function is thread safe. message_size The size in bytes of the location in which to store the returned message. errnum The error value to be decoded, usually obtained from the errno global variable just before this function is called. This is neces- sary if you need to call any code between the system call to be explained and this function, because many libc functions will alter the value of errno. pipefd The original pipefd, exactly as passed to the pipe(2) system call. SEE ALSO
pipe(2) create pipe explain_pipe_or_die(3) create pipe and report errors COPYRIGHT
libexplain version 0.52 Copyright (C) 2009 Peter Miller explain_pipe(3)
All times are GMT -4. The time now is 11:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy