Sponsored Content
Full Discussion: key_t type
Top Forums UNIX for Dummies Questions & Answers key_t type Post 302469394 by joker40 on Friday 5th of November 2010 06:16:00 PM
Old 11-05-2010
key_t type

I would like to print value of key generate like this....

Code:
key_t k = ftok(".",'c');
printf("key is %d \n" , k);

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
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

you have more and one unix type?

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)
Discussion started by: sunbird
4 Replies

2. Programming

keyboard type

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)
Discussion started by: nimishm
0 Replies

3. Shell Programming and Scripting

String type to date type

Can one string type variable changed into the date type variable. (1 Reply)
Discussion started by: rinku
1 Replies

4. Programming

array type has incomplete element type

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)
Discussion started by: jaganadh
1 Replies

5. Solaris

raid type

how to get the raid type of a mount if I am using solaris disksuite? thanks (1 Reply)
Discussion started by: melanie_pfefer
1 Replies

6. UNIX for Dummies Questions & Answers

Encoding Type

Hi, Where can I find the encoding type in a unix server ? Thanks in advance !!! (1 Reply)
Discussion started by: risshanth
1 Replies

7. Programming

key_t type max length or boundaries value

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)
Discussion started by: pronetin
2 Replies

8. Windows & DOS: Issues & Discussions

Type of RAM

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)
Discussion started by: tenderfoot
5 Replies

9. Programming

Changing type name

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
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
All times are GMT -4. The time now is 08:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy