Sponsored Content
Top Forums Programming memcpy segfaults, but not in windows Post 93524 by Perderabo on Monday 19th of December 2005 09:49:01 PM
Old 12-19-2005
Where is buffer defined? What value is in sSize? It's one of those two things. Mostly likely buffer is too small.
 

5 More Discussions You Might Find Interesting

1. Programming

Problem with memcpy

Hi , I am having records in a file like 00412772784705041008FRUITFUL STRWBRRY 00412772784703041008FRUITFUL STRWBERE 00000570632801448078 X i have declared a structure like typedef struct { char Uname; char Pname; ... (4 Replies)
Discussion started by: arunkumar_mca
4 Replies

2. Programming

Segmentation Fault by memcpy

Hello everybody, I'm coding a test program for ARP protocol, and i don't know why i'm getting a SIGSEGV, i traced it with gdb and it says it's due to the memcpy function from /lib/libc.so.6. Program received signal SIGSEGV, Segmentation fault. 0xb7e9e327 in memcpy () from /lib/libc.so.6 This... (5 Replies)
Discussion started by: Zykl0n-B
5 Replies

3. Programming

Segfaults on pointer deletion

Hey Everyone, I have a check similar to this: if (ptr) { delete ptr; ptr = null; }When I'm debugging in AIX (using dbx), if I attempt to print the value of 'ptr' it says "ptr is not defined" - however, it still enters that if block. So, I'm getting segfaults on the delete... (8 Replies)
Discussion started by: ctote
8 Replies

4. Programming

memcpy error

I am getting segmentation fault in memcpy.I have given sufficient memory but i dont know why it is occurring char *finalptr = ( char *)malloc(1048576* sizeof(char)); finaloffset=0;have=685516; memcpy(&(finalptr)+finaloffset,out,have); finaloffset=685516;have=359910;... (23 Replies)
Discussion started by: rajsekhar28
23 Replies

5. Shell Programming and Scripting

Undefined reference to memcpy@GLIBC_2.14

Dear All, I am trying to compile OpenFOAM-1.7.x in RHEL. I could not able to compile some of the applications because of libc version issues. It is saying undefined reference to memcpy@GLIBC_2.14 Can anybody look into it? Thanks & Regards, linuxUser_ (3 Replies)
Discussion started by: linuxUser_
3 Replies
KEYCTL_READ(3)						    Linux Key Management Calls						    KEYCTL_READ(3)

NAME
keyctl_read - Read a key SYNOPSIS
#include <keyutils.h> long keyctl_read(key_serial_t key, char *buffer, size_tbuflen); long keyctl_read_alloc(key_serial_t key, void **_buffer); DESCRIPTION
keyctl_read() reads the payload of a key if the key type supports it. The caller must have read permission on a key to be able to read it. buffer and buflen specify the buffer into which the payload data will be placed. If the buffer is too small, the full size of the payload will be returned, and no copy will take place. keyctl_read_alloc() is similar to keyctl_read() except that it allocates a buffer big enough to hold the payload data and places the data in it. If successful, A pointer to the buffer is placed in *_buffer. The caller must free the buffer. READING KEYRINGS
This call can be used to list the contents of a keyring. The data is presented to the user as an array of key_serial_t values, each of which corresponds to a key to which the keyring holds a link. The size of the keyring will be sizeof(key_serial_t) multiplied by the number of keys. The size of key_serial_t is invariant across dif- ferent word sizes, though the byte-ordering is as appropriate for the kernel. RETURN VALUE
On success keyctl_read() returns the amount of data placed into the buffer. If the buffer was too small, then the size of buffer required will be returned, but no data will be transferred. On error, the value -1 will be returned and errno will have been set to an appropriate error. On success keyctl_read_alloc() returns the amount of data in the buffer. On error, the value -1 will be returned and errno will have been set to an appropriate error. ERRORS
ENOKEY The key specified is invalid. EKEYEXPIRED The key specified has expired. EKEYREVOKED The key specified had been revoked. EACCES The key exists, but is not readable by the calling process. EOPNOTSUPP The key type does not support reading of the payload data. LINKING
This is a library function that can be found in libkeyutils. When linking, -lkeyutils should be specified to the linker. SEE ALSO
keyctl(1), add_key(2), keyctl(2), request_key(2), keyctl(3), request-key(8) Linux 4 May 2006 KEYCTL_READ(3)
All times are GMT -4. The time now is 11:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy