I would like to print value of key generate like this....
Is there other way to print this type. I dont think I am getting right output which is
key is 1662074913 (shouldn't it be 6362074913) since 'c' is 63 in hex (ascii table). Instead of using %d is there other way to do this.
Last edited by joker40; 11-05-2010 at 07:32 PM..
Reason: adding
As a formem unix newbe
I Just wanted to tell you about this cool site for all you confused people.
If you need to support more than one unix type:
Use this one. It's a life saver.
http://www.unixguide.net/unixguide.shtml
here (4 Replies)
hi
I am using a GUI language (based on C/C++) for my application. Now i need to identify the "Again" key in the Sun keyboard. I tried to do this by getting the ascii value (4155)of it . it was fine. but it is clashing with F12, whose ascii is 4155 in normal keyboards. Due to this either one of... (0 Replies)
Dear colleagues,
One of my friend have a problem with c code. While compiling a c program it displays a message like
"array type has incomplete element type". Any body can provide a solution for it.
Jaganadh.G (1 Reply)
Hello,
In shared memory, when using shmget function, first parameter is ket_t key.
I know it is an integer type, but length of it is system dependent. That means may not be have integer's ranges.
What is range of key_t in Linux? Is it different in distros, for example in ubuntu & fedora? (2 Replies)
Hello All
Is there a way I can find out the type of RAM (DDR1 or DDR2 or DDR3), I'm using withoout opening the cabinet?
Any Windows command?
Thanks in advance. (5 Replies)
In C++, how can I change the type with another name
For example
How can I declaring an object real which would be the same as declaring it float (5 Replies)
Discussion started by: kristinu
5 Replies
LEARN ABOUT NETBSD
ftok
FTOK(3) BSD Library Functions Manual FTOK(3)NAME
ftok -- create IPC identifier from path name
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <sys/types.h>
#include <sys/ipc.h>
key_t
ftok(const char *path, int id);
DESCRIPTION
The ftok() function attempts to create a unique key suitable for use with the msgget(2), semget(2) and shmget(2) functions given the path of
an existing file and a user-selectable id.
The specified path must specify an existing file that is accessible to the calling process or the call will fail. Also, note that links to
files will return the same key, given the same id.
Only the 8 least significant bits of id are used in the key generation; the rest of the bits are ignored.
RETURN VALUES
The ftok() function will return ((key_t)-1) if path does not exist or if it cannot be accessed by the calling process.
SEE ALSO msgget(2), semget(2), shmget(2)STANDARDS
The ftok() function conforms to IEEE Std 1003.1 (``POSIX.1'').
HISTORY
The ftok() function originated with System V and is typically used by programs that use the System V IPC routines.
AUTHORS
Thorsten Lockert <tholo@sigmasoft.com>
BUGS
The returned key is computed based on the device and inode of the specified path in combination with the given id. Thus it is quite possible
for the routine to return duplicate keys given that those fields are not 8- and 16-bit quantities like they were on System V based systems
where this library routine's ancestor were originally created.
BSD April 27, 2010 BSD