02-20-2006
file pointer
what is the difference between a file pointer and a file descriptor.
10 More Discussions You Might Find Interesting
1. Programming
void main()
{
int a={1,2,3,4,5,6,7,8,9,10};
int *p=a;
int *q=&a;
cout<<q-p+1<<endl;
}
The output is 10, how?
if we give cout<<q it will print the address, value won't print....
if we give cout<<p it will print the address, value won't print....
p has the base addr; q... (1 Reply)
Discussion started by: sarwan
1 Replies
2. Programming
hi all:
bankpro again,
i want to open a file and close it after an hour (i.e open and close the file ptr)
In the mean time i will be executing my jobs using the shell (CommandInterpreter).
plz help... :cool: (3 Replies)
Discussion started by: bankpro
3 Replies
3. UNIX for Dummies Questions & Answers
Hi everybody,
i am newbie to unix and confused with file pointers and file descripters.
could anyone help me to clear my doubts ..
when we call unix system calls to create a file then we are dealing wih file descripters
i think file descripters are also normals file as stored inhard disks... (1 Reply)
Discussion started by: johnray31
1 Replies
4. Programming
can u tell me the reson that why we should not delete a pointer twice.?
if we delete ponter twice then what happen and why this happen
Regards,
Amit (2 Replies)
Discussion started by: amitpansuria
2 Replies
5. Programming
what is far pointer in C (1 Reply)
Discussion started by: useless79
1 Replies
6. Shell Programming and Scripting
I have a text file that has blocks of text. Each block starts with ### and ends with End_###.
I wrote a perl script to search a string from line 2 (ignore any line starts with ###) of each block
if matched, need to print that whole block. According to the input file in below, it will print... (5 Replies)
Discussion started by: tqlam
5 Replies
7. Programming
Hello experts,
I ve a text file I want to go to particular line . what is the best way to do this in c ?
I am tried as follows
fseek ( fh, pos, SEEK_SET);
but this functions moves the file pointer according to a number of bytes. Unfortunately I don't know the exact byte... (7 Replies)
Discussion started by: user_prady
7 Replies
8. Programming
If one wants to get a start address of a array or a string or a block of memory via a function, there are at least two methods to achieve it:
(1) one is to pass a pointer-to-pointer parameter, like:
int my_malloc(int size, char **pmem)
{
*pmem=(char *)malloc(size);
if(*pmem==NULL)... (11 Replies)
Discussion started by: aaronwong
11 Replies
9. UNIX for Dummies Questions & Answers
hi....,
can anyone tell me what is the exact difference between file descriptor and file pointer...... and why file descriptor takes integer value???:confused: (10 Replies)
Discussion started by: jimmyuk
10 Replies
10. Programming
if i declare both but don't input any variables what values will the int array and file pointer array have on default, and if i want to reset any of the elements of both arrays to default, should i just set it to 0 or NULL or what? (1 Reply)
Discussion started by: omega666
1 Replies
LEARN ABOUT OPENSOLARIS
scsi_find_sense_descr
scsi_find_sense_descr(9F) Kernel Functions for Drivers scsi_find_sense_descr(9F)
NAME
scsi_find_sense_descr - find descriptor in SCSI sense data
SYNOPSIS
#include <sys/scsi/scsi.h>
uint8_t *scsi_find_sense_descr(uint8_t *sense_buffer, int sense_buf_len,
int req_descr_type);
INTERFACE LEVEL
Solaris DDI specific (Solaris DDI).
PARAMETERS
sense_buffer Pointer to a buffer containing SCSI descriptor sense data. The data is expected in wire format starting at the response
code.
sense_buf_len Integer that contains the length of sense buffer in bytes.
req_descr_type Integer that contains the descriptor type value for the desired sense descriptor.
DESCRIPTION
The scsi_find_sense_descr() function is used to obtain a pointer to a specific descriptor type, specified by req_descr_type, within a
descriptor sense buffer. Before returning the pointer, scsi_find_sense_descr() verifies that the entire descriptor is present based on the
length provided in sense_buf_len.
Any value for req_descr_type can be requested. The following descriptor types are already defined:
#define DESCR_INFORMATION 0x00
#define DESCR_COMMAND_SPECIFIC 0x01
#define DESCR_SENSE_KEY_SPECIFIC 0x02
#define DESCR_FRU 0x03
#define DESCR_STREAM_COMMANDS 0x04
#define DESCR_BLOCK_COMMANDS 0x05
#define DESCR_OSD_OID 0x06
#define DESCR_OSD_RESP_INTEGRITY 0x07
#define DESCR_OSD_ATTR_ID 0x08
Drivers should use scsi_validate_sense(9F) to ensure that the sense buffer contains valid descriptor sense data.
RETURN VALUES
The scsi_find_sense_descr() function returns a pointer to a sense descriptor of the requested type if a descriptor of that type exists. If
no such descriptor exists, scsi_find_sense_descr() returns NULL.
CONTEXT
The scsi_find_sense_descr() function can be called from user or interrupt context.
SEE ALSO
scsi_ext_sense_fields(9F), scsi_sense_asc(9F), scsi_sense_ascq(9F), scsi_sense_cmdspecific_uint64(9F), scsi_sense_info_uint64(9F),
scsi_sense_key(9F), scsi_validate_sense(9F)
SunOS 5.11 30 Jun 2006 scsi_find_sense_descr(9F)