06-03-2007
History.
If I have a function pointer in C
typedef int (*foo_ptr)(void);
foo_ptr my_foo;
I can either
(a) leave it to be undefined and a danger to all who touch it
(b) set it to point to an implementation of foo()
(c) set it to NULL or (foo_ptr)0 so people can check it's validity.
C++ is derived from C and setting it to 0 is an indication that this class does not provide an implementation of this function.
There are other places where a non-zero initialisation of a pointer is special such as the SIG_IGN/SIG_DFL and _XtInherit.
Unless you are either (a) implementing a C++ compiler (b) answering a homework question, the reason why is not actually important.
9 More Discussions You Might Find Interesting
1. Programming
I am pondering the next question:
Can I safely sare objects that have virtual functions (i.e. have
virtual function table pointers) between two processes ?
Where will the pointers point to in each process ?
What I am afraid of is that in the creating process the pointer
will indeed point to... (2 Replies)
Discussion started by: Seeker
2 Replies
2. UNIX for Advanced & Expert Users
Hello,
I would like to know if there is a command or any configuration file to find and differentiate the Virtual IP Addresses (of the Cluster Resource Group) and the IP Address of the Cluster Node. I observe that the ifconfig -a command returns all the IP addresses configured on the ... (1 Reply)
Discussion started by: vineetd
1 Replies
3. UNIX for Dummies Questions & Answers
Hi Folks,
I want to check all the virtual hostname's/IP's of a host/ip. Currently we are using HP-UX and open SuSe. Please tell me the command to list out all virtual names of a particular host.
many thanks in advance. (2 Replies)
Discussion started by: sai21
2 Replies
4. Solaris
Do we have any Virtual Data Center software as we have Virtual Machine?
I want to practice everything of Solaris practically but i don't have resources like data center which includes Servers, Data storages, switches, and other things. (2 Replies)
Discussion started by: karman0931
2 Replies
5. UNIX for Dummies Questions & Answers
Not really a newbie, but I have a strange problem and I'm not sure how to further troubleshoot it.
I have to log out of a virtual terminal by typing exit, then exit again as in:
woodnt@toshiba-laptop ~ $ exit
logout
woodnt@toshiba-laptop ~ $ exit
logout
I DON'T have to do this when I'm... (1 Reply)
Discussion started by: Narnie
1 Replies
6. UNIX for Advanced & Expert Users
I want address of current virtual memory block?
i am using fedora10:wall::wall: (1 Reply)
Discussion started by: powyama
1 Replies
7. Solaris
Trying to set or modify the randomly set hostID of a Solaris 10 virtual/guest machine that I installed on a Windows-XP host machine (using Virtual Box 4.1.12).
I was able to set/modify the hostname of the Solaris 10 virtual/guest machine during installation as well as via the Virtual Box... (4 Replies)
Discussion started by: Matt_VB
4 Replies
8. Programming
Have difficulty to understand this pure C code to only print vowels twice from input string. Questions are commented at the end of each place.
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
/*
*Demonstrate the use of dispatch tables
*/
/*Print a char... (11 Replies)
Discussion started by: yifangt
11 Replies
9. UNIX for Beginners Questions & Answers
Hi All,
Is there any way I can prioritize my VMs when there is resource crunch in host machine so that some VMs will be allocated more vcpu, more memory than other VMs in kvm/qemu hypervisor based virtual machines?
Lets say in my cloud environment my Ubuntu 16 compute hosts are running some... (0 Replies)
Discussion started by: SanjayK
0 Replies
LEARN ABOUT DEBIAN
pure-pw
pure-pw(8) Pure-FTPd pure-pw(8)
NAME
pure-pw - Manage virtual users files for Pure-FTPd
SYNTAX
pure-pw useradd login [-f passwd_file] [-F puredb_file] -u uid [-g gid]
-D/-d home_directory [-c gecos]
[-t download_bandwidth] [-T upload_bandwidth]
[-n max number_of_files] [-N max_Mbytes]
[-q upload_ratio] [-Q download_ratio]
[-r <allow client host>/<mask>[,<ip>/<mask>]...] [-R <deny client host>/<mask>[,<ip>/<mask>]...]
[-i <allow local host>/<mask>[,<ip>/<mask>]...] [-I <deny local host>/<mask>[,<ip>/<mask>]...]
[-y <max number of concurrent sessions>]
[-z <hhmm>-<hhmm>] [-m]
pure-pw usermod login [-f passwd_file] [-F puredb_file] [-u uid] [-g gid]
-D/-d home_directory -[c gecos]
[-t download_bandwidth] [-T upload_bandwidth]
[-n max_number_of_files] [-N max_Mbytes]
[-q upload_ratio] [-Q download_ratio]
[-r <allow client host>/<mask>[,<ip>/<mask>]...] [-R <deny client host>/<mask>[,<ip>/<mask>]...]
[-i <allow local host>/<mask>[,<ip>/<mask>]...] [-I <deny local host>/<mask>[,<ip>/<mask>]...]
[-y <max number of concurrent sessions>]
[-z <hhmm>-<hhmm>] [-m]
pure-pw userdel login [-f passwd_file] [-F puredb_file] [-m]
pure-pw passwd login [-f passwd_file] [-F puredb_file] [-m]
pure-pw show login [-f passwd_file] [-m]
pure-pw mkdb [<puredb_database_file> [-f passwd_file]] [-F puredb_file]
pure-pw list [-f passwd_file]
DESCRIPTION
Virtual users is a simple mechanism to store a list of users, with their password, name, uid, directory, etc. It's just like /etc/passwd.
But it's not /etc/passwd. It's a different file, only for FTP.
It means that you can easily create FTP-only accounts without messing your system accounts.
Additionnaly, virtual users files can store individual quotas, ratios, bandwidth, etc. System accounts can't do this.
Thousands of virtual users can share the same system user, as long as they all are chrooted, and they have their own home directory.
FILES
/etc/pure-ftpd/pureftpd.passwd
/etc/pure-ftpd/pureftpd.pdb
ENVIRONMENT VARIABLES
PURE_PASSWDFILE If this variable is defined, this is the default value for the text password file. Without this variable, /etc/pure-
ftpd/pureftpd.passwd is assumed.
PURE_DBFILE If this variable is defined, this is the default value for the PureDB password file. Without this variable, /etc/pure-
ftpd/pureftpd.pdb is assumed.
EXAMPLES
Please read http://download.pureftpd.org/pub/pure-ftpd/doc/README.Virtual-Users
AUTHORS
Frank DENIS <j at pureftpd dot org>
SEE ALSO
ftp(1), pure-ftpd(8) pure-ftpwho(8) pure-mrtginfo(8) pure-uploadscript(8) pure-statsdecode(8) pure-pw(8) pure-quotacheck(8) pure-authd(8)
RFC 959, RFC 2228, RFC 2389 and RFC 2428.
Pure-FTPd team 1.0.36 pure-pw(8)