1. use send() & recv() on sockets they are meant for that and return more meaningfull error codes.
2. the syntax for write does not include a format string like:"%d %d" - the same is true for read
example:
You code cannot have compiled at all. Always check the return code from system calls. The 0 (flags argument) for recv lets you do neat stuff like MSG_PEEK.
How can 'popen()' be used for reading and writing to opening pipe?
If i try 'popen("prog", "rw")'
and then put and get chars - it does
not work.
What is wrong? (1 Reply)
I am trying to write a script that will do a sql statement. But in the sql I will have a list (1,2,3,4).
How would I go about asking for the input from the user running the script, and then transferring that back into the list as say ($var1,$var2,$var3)?
It would be somewhat like this:
... (1 Reply)
I need to find all the files that have group Read or Write permission or files that have user write permission.
This is what I have so far:
find . -exec ls -l {} \; | awk '/-...rw..w./ {print $1 " " $3 " " $4 " " $9}'
It shows me all files where group read = true, group write = true... (5 Replies)
Hi all,
I have a problem with some read/write functions.
I have a .bin file which contains a lot of structures as follows:
struct alumno
{
char id;
char apellido1;
char apellido2;
char nombre;
float nota1p;
float nota2p;
float notamedia;
char photofilename;
};
What I have... (3 Replies)
Hi,
We have smb client running on two of the linux boxes and smb server on another linux system. During a backup operation which uses smb, read of a file was allowed while write to the same file was going on.Also simultaneous writes to the same file were allowed.Following are the settings in the... (1 Reply)
HI
I need to implement a client/server TCP application. the customer is the client and the bartender is the server.
When the customer enter the Bar, client connects to the server
Server should reply the client immediately. Other wise if the server is busy, it should send an update message... (10 Replies)
EDIT: Nevermind. I found a forth kludge to get around the psed requirement!
Short version: I'm trying to use the "w" flag with psed to write all substituted lines into another file. No matter how many times I read the man pages or search with Google, I can't seem to find the proper syntax... (0 Replies)
Hi Everyone,
newbie here, please help me i can't read the code i'm confused reading this code.
select c.net_svc_id, c.inst_st_dt into ${REO_RECON_USERID_LUZON_TEMP} from ${WO_INST_SITE_COMP_FIELDS} a, ${WO_INST_SITE_COMPONENTS} b, ${WO_INST} c where a.cust_ac_no = b.cust_ac_no and... (3 Replies)
I have got a file in following format:
AAAAAAA
BBBBBBBB
CCCCCCC
DDDDDDD
I am trying to read this file and out put it in following format:
AAAAAAA,BBBBBBB,CCCCCCC,DDDDDD
Preferred method is shell or Perl.
Any help appreciated. (11 Replies)
Can someone help me to write this program in C in QNX?
Using the FIFO queues write a simple communication system consisting of programs write and read. The program write the parameters given strings enclosed in single quotes. These strings are written to the FIFO file. Reads the program read... (1 Reply)
Discussion started by: ebasse2
1 Replies
LEARN ABOUT CENTOS
papi_add_event
PAPI_add_event(3) PAPI PAPI_add_event(3)NAME
PAPI_add_event -
add PAPI preset or native hardware event to an event set
SYNOPSIS Detailed Description
@par C Interface:
int PAPI_add_event( int EventSet, int EventCode );
PAPI_add_event adds one event to a PAPI Event Set. @n
A hardware event can be either a PAPI preset or a native hardware event code.
For a list of PAPI preset events, see PAPI_presets or run the avail test case
in the PAPI distribution. PAPI presets can be passed to PAPI_query_event to see
if they exist on the underlying architecture.
For a list of native events available on current platform, run the papi_native_avail
utility in the PAPI distribution. For the encoding of native events,
see PAPI_event_name_to_code to learn how to generate native code for the
supported native event on the underlying architecture.
@param EventSet
An integer handle for a PAPI Event Set as created by PAPI_create_eventset.
@param EventCode
A defined event such as PAPI_TOT_INS.
@retval Positive-Integer
The number of consecutive elements that succeeded before the error.
@retval PAPI_EINVAL
One or more of the arguments is invalid.
@retval PAPI_ENOMEM
Insufficient memory to complete the operation.
@retval PAPI_ENOEVST
The event set specified does not exist.
@retval PAPI_EISRUN
The event set is currently counting events.
@retval PAPI_ECNFLCT
The underlying counter hardware can not count this event and other events
in the event set simultaneously.
@retval PAPI_ENOEVNT
The PAPI preset is not available on the underlying hardware.
@retval PAPI_EBUG
Internal error, please send mail to the developers.
@par Examples:
* int EventSet = PAPI_NULL;
* unsigned int native = 0x0;
* if ( PAPI_create_eventset( &EventSet ) != PAPI_OK )
* handle_error( 1 );
* // Add Total Instructions Executed to our EventSet
* if ( PAPI_add_event( EventSet, PAPI_TOT_INS ) != PAPI_OK )
* handle_error( 1 );
* // Add native event PM_CYC to EventSet
* if ( PAPI_event_name_to_code( "PM_CYC", &native ) != PAPI_OK )
* handle_error( 1 );
* if ( PAPI_add_event( EventSet, native ) != PAPI_OK )
* handle_error( 1 );
*
@see PAPI_cleanup_eventset @n
PAPI_destroy_eventset @n
PAPI_event_code_to_name @n
PAPI_remove_events @n
PAPI_query_event @n
PAPI_presets @n
PAPI_native @n
PAPI_remove_event.fi
Author
Generated automatically by Doxygen for PAPI from the source code.
Version 5.2.0.0 Tue Jun 17 2014 PAPI_add_event(3)