Sponsored Content
Full Discussion: Making a system call
Top Forums Programming Making a system call Post 302078949 by hardwickj on Wednesday 5th of July 2006 05:47:02 PM
Old 07-05-2006
Making a system call

This is a total nooby question, but here goes...

I am trying to do something in C for the very first time, and doing it in Solaris, for the very first time. It would otherwise be easy enough to test out and find out, but I wont be able to do so until the week after next for various reasons, so I was just wondering if this would work...

I am replacing a script file with C code. The script starts out such as:

#!/bin/ksh
export BUILD_DIR=`cat /nssn/cm/current_build`
export HOSTNAME=`hostname`
echo ColdStart>$BUILD_DIR/logs/StartType
etc...

so, can I just replace that with system calls such as:

system("#!/bin/ksh");
system("export BUILD_DIR=`cat /nssn/cm/current_build`");
system("export HOSTNAME=`hostname`");
etc...

At first I thought yes but then I wondered, does each system call sort of call in a different shell? If so, would the environment variable defined in one system call be seen from another system call?

If that is a problem, is there any way to do all of the system calls in a single system call?

Help a noob out...and thanks for any help in advance!!!
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Making a SOAP call from within unix shell scripts

Hi guys, Is it possible to make SOAP calls from within Unix shell scripts? I need to access a web service from within UNIX in order to lookup something while I am doing some parsing on a file. Regards, Laud (2 Replies)
Discussion started by: Laud12345
2 Replies

2. Linux

Making Socket System Call From Linux Kernel Module?

Hi Everyone! How can we make a socket() system call from a linux module executing in kernel space? If any one knows, kindly tell me. It will be great. I want to use the socket interface in linux kernel space for sending raw packets over the network. Hamayun (0 Replies)
Discussion started by: mian_m_hamayun
0 Replies

3. UNIX for Advanced & Expert Users

how to differentiate system call from library call

Hi, Ho do I differentiate system call from library call? for example if I am using chmod , how do I find out if it is a system call or library call? Thanks Muru (2 Replies)
Discussion started by: muru
2 Replies

4. Programming

c system call

How the c compiler differentiates the system calls and function calls? (1 Reply)
Discussion started by: rangaswamy
1 Replies

5. Shell Programming and Scripting

system call

Hi, How to write a system calls in a script ? > cd $HOME > ls -ltr thanks in advance.. (10 Replies)
Discussion started by: hegdeshashi
10 Replies

6. Programming

C:system call

Hi I'm studing the system call. I've written a small program that return the time spent in doing some operations. Now I'd like to write one that return the time spent in user mode of a process. I'm reading that i should use the tms struct: clock_t times(struct tms *buf); struct tms {... (2 Replies)
Discussion started by: Dedalus
2 Replies

7. UNIX for Dummies Questions & Answers

Making tar of a remote file system

Hello, I was asked by my boss to make a backup of one of our systems that is slated to be decommissioned. When I suggested if could tar the "/" directory he nodded and said that would do the trick, When I try and execute the command I get EOF error. I think it is because there is not enough... (2 Replies)
Discussion started by: mojoman
2 Replies

8. Shell Programming and Scripting

system call

Trying to figure out a load issue with a webserver. I have traced a php script and noticed the following connect(4, {sa_family=AF_INET, sin_port=htons(3306), sin_addr=inet_addr("XX.XX.XX.XX")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000035> poll(, 1, 2000) = 1 () <0.000120>... (5 Replies)
Discussion started by: rajan007
5 Replies

9. Solaris

Making HDD backup in sun Solaris system

Hello to all, I have Fujitsu Celzius M470 workstation which has Sun solaris system installed and want to make a complete backup of the hard drive. The existing HDD is SATA II, 500 GB. I don't have much experience working with SUN solaris systems (not at all) but have some experience with... (5 Replies)
Discussion started by: Mick
5 Replies
PAPI_ipc(3)							       PAPI							       PAPI_ipc(3)

NAME
PAPI_ipc - Simplified call to get instructions per cycle, real and processor time. SYNOPSIS
Detailed Description C Interface: #include <papi.h> int PAPI_ipc( float *rtime, float *ptime, long long *ins, float *ipc ); Parameters: *rtime total realtime since the first call *ptime total process time since the first call *ins total instructions since the first call *ipc incremental instructions per cycle since the last call Return values: PAPI_EINVAL The counters were already started by something other than PAPI_ipc(). PAPI_ENOEVNT The floating point operations event does not exist. PAPI_ENOMEM Insufficient memory to complete the operation. The first call to PAPI_ipc() will initialize the PAPI High Level interface, set up the counters to monitor PAPI_TOT_INS and PAPI_TOT_CYC events and start the counters. Subsequent calls will read the counters and return total real time, total process time, total instructions since the start of the measurement and the IPC rate since the latest call to PAPI_ipc(). A call to PAPI_stop_counters() will stop the counters from running and then calls such as PAPI_start_counters() or other rate calls can safely be used. PAPI_ipc should return a ratio greater than 1.0, indicating instruction level parallelism within the chip. The larger this ratio the more effeciently the program is running. See Also: PAPI_flips() PAPI_flops() PAPI_epc() PAPI_stop_counters() Author Generated automatically by Doxygen for PAPI from the source code. Version 5.2.0.0 Tue Jun 17 2014 PAPI_ipc(3)
All times are GMT -4. The time now is 09:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy