Sponsored Content
Full Discussion: mysterious #define
Top Forums Programming mysterious #define Post 302118999 by Perderabo on Friday 25th of May 2007 11:03:18 PM
Old 05-26-2007
I was just using SOMETHING as an sample macro name. Since that freaked you out, let's just use your example.

#ifdef JOB_CONTROL
signal(SIGTSTP,(RETSIGTYPE (*)())susp);
#endif /*JOB_CONTROL*/

One of two things will happen as a result of the above code.

case 1.
Somewhere earlier we encountered a "#define JOB_CONTROL" line. If so we will get that signal line.

case 2.
We never encountered any "#define JOB_CONTROL" line. If so we get nothing.


So now we can control whether or not the program supports job control by the presense or absence of the "#define JOB_CONTROL" line. Choosing a name like SOMETHING would have been bad. But JOB_CONTROL is a good choice for this macro.
 

7 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Mysterious Server Shutdown

Virtually no UNIX admin experience. Any admin duties are shared by several folks with no special training. Today we had our Sun v880 server, running Solaris 5.8, shutdown for no apparent reason. When we checked on server we found it completely powered down, yet still connected to a fully... (6 Replies)
Discussion started by: buechler66
6 Replies

2. UNIX for Dummies Questions & Answers

#define in perl

Hi friends, I am not sure if perl questions can be raised here. :rolleyes: But I have a doubt if there is a way to do "#define" in perl, like in C. Does anyone know if it is feasible (without CPAN modules)? Thanks, Srini (7 Replies)
Discussion started by: srinivasan_85
7 Replies

3. Programming

mysterious execution failure and core dump generation

Posting again, as previous query had a typo. ======================================================= Hi, I am running a c++ program in unix AIX machine. There are two functions in a file which are being used by a third function in the same file. the two functions being used are of the same type.... (1 Reply)
Discussion started by: suresh_kb211
1 Replies

4. Programming

#define

Hello, I would like to conditionaly comment in my code source some fields from arrays. So I use the property ## from the #define definition. my code: ... #define slet /##* #define etsl *##/ ... const T_SVT_ADLL_A653_DESC A_DESC = { { slet qwerty etsl SLICING,... (3 Replies)
Discussion started by: cypleen
3 Replies

5. Programming

help with #define in C

if i do this in C #define NUM 1234512345 then how come i cant print it out using int main(int argc, char **argv) { printf("%d\n", NUM); return 0; } well the result is -1219236538, why isnt it 1234512345 ? (7 Replies)
Discussion started by: omega666
7 Replies

6. Programming

#define in c

Hi, I had a head file, looks like #define MIN_NUM 10 #define MAX_NUM 10 is there any way to get "MAX_NUM" from 10? thanks. peter (9 Replies)
Discussion started by: laopi
9 Replies

7. Shell Programming and Scripting

Debugging mysterious perl script problem

the attached perl script is a deamon that, once kicked off from the command line, it runs in the background and waits for the master server to tell it what plugins to run. the script works well. but the problem is, whenever i start it, after about a few seconds of starting it, i start getting... (4 Replies)
Discussion started by: SkySmart
4 Replies
acct(5) 							File Formats Manual							   acct(5)

Name
       acct - execution accounting file

Syntax
       #include <sys/acct.h>

Description
       The  system  call makes entries in an accounting file for each process that terminates.	The accounting file is a sequence of entries whose
       layout, as defined by the include file, is:
       typedef u_short comp_t
       struct  acct
       {
	       char    ac_comm[10];   /* Accounting command name */
	       comp_t  ac_utime;      /* Accounting user time */
	       comp_t  ac_stime;      /* Accounting system time */
	       comp_t  ac_etime;      /* Accounting elapsed time */
	       time_t  ac_btime;      /* Beginning time */
	       short   ac_uid;	      /* Accounting user ID */
	       short   ac_gid;	      /* Accounting group ID */
	       short   ac_mem;	      /* average memory usage */
	       comp_t  ac_io;	      /* number of disk IO blocks */
	       dev_t   ac_tty;	      /* control typewriter */
	       char    ac_flag;       /* Accounting flag */
       };

       #define AFORK   0001    /* has executed fork, but no exec */
       #define ASU     0002    /* used super-user privileges */
       #define ACOMPAT 0004    /* used compatibility mode */
       #define ACORE   0010    /* dumped core */
       #define AXSIG   0020    /* killed by a signal */
       #define AHZ     64      /* the accuracy of data is 1/AHZ */

       #ifdef KERNEL
       struct  acct    acctbuf;
       struct  gnode   *acctp;
       #endif
       If the process does an the first 10 characters of the file name appear in ac_comm.  The accounting flag contains  bits  indicating  whether
       was ever accomplished and whether the process ever had superuser privileges.

See Also
       acct(2), execve(2), sa(8)

								       RISC								   acct(5)
All times are GMT -4. The time now is 04:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy