Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

setprogname(3) [debian 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

Check Out this Related 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) HISTORY
These functions first appeared in NetBSD 1.6, and made their way into FreeBSD 4.4. BSD
May 1, 2001 BSD
Man Page

11 More Discussions You Might Find Interesting

1. BSD

Floppy drive problem.

My FreeBSD install at ad0s1, and Windows 2000 at ad2s1. Everytime I start my FreeBSD, it shows me this message: fdc0: cmd 3 failed at out byte 1 of 3 pmtimer 0 on isa0 fdc0: cannot reserve I/O port range (6 ports) My Floppy drive info: 0x03F2 - 0x03F3 0x03F4 - 0x03F5 0x03F7 - 0x03F7... (6 Replies)
Discussion started by: _cs
6 Replies

2. BSD

FreeBSD 5.2.1

I want someone tell me the positives and negatives points of FreeBSD 5.2.1, if someone help me, i thanks a lot! (4 Replies)
Discussion started by: israel
4 Replies

3. BSD

I want the Best FREEBSD

B]I want the best of the best FreeBSD version for my study in Unix...please sugest me... Thanks (5 Replies)
Discussion started by: israel
5 Replies

4. BSD

trouble executing and running on BSD from DG

Hi, I recently installed FreeBSD 6.0, and am now trying to run my newly created sh scripts, that I ftp'd over from my works Data General - Unix server, I thought they would at least sumwhat/part run, but I can'y even get my basic menu to run and don't know why, can anyone help me by throwing... (6 Replies)
Discussion started by: Gerry405
6 Replies

5. BSD

please help me in FreeBSD

Hi to all, Iam doing a project in Free BSD and i am stuck with a puzzle. Please any one of you clarify my doubt : How to add a mechanism to check the status of the file system which alerts the root user via. email if any single partition is greater than 90% full. This alert should include the... (3 Replies)
Discussion started by: tadakamalla
3 Replies

6. BSD

FreeBSD on a Laptop

In this post, hitechredneck said: I lost the C drive in my venerable Inspiron 8200 :eek: I have installed a temporary replacement C drive and I have a Seagate ST910021A on order for it. If I can get that drive to work with my Inspiron 8200, I am going to install a quad boot... (4 Replies)
Discussion started by: Perderabo
4 Replies

7. BSD

Broadcom 4312 in BSD

Is there a way to configure Broadocom wifi 4312 in a bsd system, FreeBSD or OpenBSD. I will appreciate any kind of help. Thanks in advance (1 Reply)
Discussion started by: piukeman
1 Replies

8. BSD

LFS-like thing, but with *BSD?

Hi, do you know, is there any thing like Linux From Scratch, but for a BSD operating system? A tutorial or guide to learn (and build) the system inside out? Would be pretty cool IMO. :D Blackbird (1 Reply)
Discussion started by: Blackbird
1 Replies

9. 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

10. 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

11. Programming

GCC: General Macro for BSD

Is there a universal macro for any BSD system. I am currently on FreeBSD where __FreeBSD__ is defined. It looks like on NetBSD systems __NetBSD__ is defined. I have tried using __BSD__ but doesn't appear to exists. Is there a universal way of testing if you are using any BSD system with GCC?... (6 Replies)
Discussion started by: AntumDeluge
6 Replies