Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

setprogname(3) [freebsd man page]

GETPROGNAME(3)						   BSD Library Functions Manual 					    GETPROGNAME(3)

NAME
getprogname, setprogname -- get or set the program name LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <stdlib.h> const char * getprogname(void); void setprogname(const char *progname); DESCRIPTION
The getprogname() and setprogname() functions manipulate the name of the current program. They are used by error-reporting routines to pro- duce consistent output. The getprogname() function returns the name of the program. If the name has not been set yet, it will return NULL. The setprogname() function sets the name of the program to be the last component of the progname argument. Since a pointer to the given string is kept as the program name, it should not be modified for the rest of the program's lifetime. In FreeBSD, the name of the program is set by the start-up code that is run before main(); thus, running setprogname() is not necessary. Programs that desire maximum portability should still call it; on another operating system, these functions may be implemented in a portabil- ity library. Calling setprogname() allows the aforementioned library to learn the program name without modifications to the start-up code. SEE ALSO
err(3), setproctitle(3) HISTORY
These functions first appeared in NetBSD 1.6, and made their way into FreeBSD 4.4. BSD
May 1, 2001 BSD

Check Out this Related Man Page

GETPROGNAME(3)						   BSD Library Functions Manual 					    GETPROGNAME(3)

NAME
getprogname, setprogname -- get or set the program name LIBRARY
Utility functions from BSD systems (libbsd, -lbsd) SYNOPSIS
#include <bsd/stdlib.h> const char * getprogname(void); void setprogname(const char *progname); DESCRIPTION
The getprogname() and setprogname() functions manipulate the name of the current program. They are used by error-reporting routines to pro- duce consistent output. The getprogname() function returns the name of the program. If the name has not been set yet, it will return NULL. The setprogname() function sets the name of the program to be the last component of the progname argument. Since a pointer to the given string is kept as the program name, it should not be modified for the rest of the program's lifetime. In FreeBSD, the name of the program is set by the start-up code that is run before main(); thus, running setprogname() is not necessary. Programs that desire maximum portability should still call it; on another operating system, these functions may be implemented in a portabil- ity library. Calling setprogname() allows the aforementioned library to learn the program name without modifications to the start-up code. SEE ALSO
err(3), setproctitle(3) HISTORY
These functions first appeared in NetBSD 1.6, and made their way into FreeBSD 4.4. BSD
May 1, 2001 BSD
Man Page

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Where do I start to learn PERL?

Hello, What is the best way to start learning PERL? Are there any "learn-it-yourself" websites? Beginner books? etc... Thanks, Barbara (3 Replies)
Discussion started by: blt123
3 Replies

2. Programming

External comands in C?

Hey all, I'm writting my first C program (Apart from the little ones I did to learn the program). What I want for this program to do is ping a range of IP's and then place the reply if alive into a file the compare all in that file to the /etc/hosts file to find the host name. I know I... (2 Replies)
Discussion started by: merlin
2 Replies

3. UNIX for Dummies Questions & Answers

FreeBSD or Linux, which one is more fit for new man

Hello everyone. I'm a Chinese student.I want to learn something about OS, someone suggests me start with FreeBSD or Linux. Please tell me which one is more fit for new man. Thanks. (4 Replies)
Discussion started by: discoverer8713
4 Replies

4. UNIX for Dummies Questions & Answers

Running a program (Dynflow)

Lets get some stuff out of the way before the question. I am currently running FreeBSD 7.0 on a VirtualBox virtual machine. I do not know much about Unix or FreeBSD, though I do run linux at home. My boss gave me some files that he says are a unix version of the program Dynflow. The Programs... (0 Replies)
Discussion started by: poet_will
0 Replies

5. Programming

Do pro*c program need to recompile

hi, I have pro*c program running on sunsolaris 5.9.Currently the same program has been migrated to solaris 5.10.But the program is not giving the desired output.Do i need to recomplie the source code again. Regards, Megh (4 Replies)
Discussion started by: megh
4 Replies

6. AIX

Calling functions from main program from dlopened library function

Hello All, I am trying to call a function from the calling main program from a dlopened library function, below is the entire code, when I execute it it crashes with sigill. Can you guys help me out I guess I am missing out on the linker flag or something here. besides I am new to AIX and... (1 Reply)
Discussion started by: syedtoah
1 Replies