Hi All,
We have the commands top and ps through which we can find out the size of the running process.
These commnds are giving the size of my process in MB after rounding of the size.
Is there any way by which I can get the size of my process in Bytes or KBytes.
Any help would be greatly... (2 Replies)
Hi all,
Does anybody know or guide me on how to remove the first N bytes and the last N bytes from a binary file? Is there any AWK or SED or any command that I can use to achieve this?
Your help is greatly appreciated!!
Best Regards,
Naveen. (1 Reply)
The title is clear: why does ext3 allocate 8 blocks for files that are few bytes long?
If I create a file named "test", put a few chars in it, and then I run:
stat test
I get that "Blocks: 8"
I searched in the web and found that ext does that, it allocates 8 blocks even if It doesn't need... (4 Replies)
Any clues on how to get rid of this PHP error?
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 71 bytes) in /website/www/includes/functions_manpages.php on line 58
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 71... (4 Replies)
Hi,
If I want to copy a 1024 byte data stream in to the target location in 3-bytes chunk, I guess I can use the following script.
dd bs=1024 count=3 if=/src of=/dest
But, I would like to know, how to do it via a C program. I have tried this with memcpy(), that did not help. (3 Replies)
Hello guys. I really hope someone will help me with this one..
So, I have to write this script who:
- creates a file home/student/vmdisk of 10 mb
- formats that file to ext3
- mounts that partition to /mnt/partition
- creates a file /mnt/partition/data. In this file, there will... (1 Reply)
Hi Friends,
Could you please tell me why i am getting the below eror while working with awk. I am confused :confused: what to do ?
awk: 0602-591 String 1,9,20,6,6 cannot be longer than 399 bytes. The source line is 1.
The error context is
>>> <<<
awk: 0602-591... (2 Replies)
hello,
suppose, entered input is of 1-40 bytes, i need it to be converted to 40 bytes exactly.
example: if i have entered my name anywhere between 1-40 i want it to be stored with 40 bytes exactly.
enter your name:
donald duck (this is of 11 bytes)
expected is as below - display 11... (3 Replies)
Discussion started by: shravan.300
3 Replies
LEARN ABOUT HPUX
xtrealloc
XtRealloc() XtRealloc()
Name
XtRealloc - change the size of an allocated block of storage.
Synopsis
char *XtRealloc(ptr, num);
char *ptr;
Cardinal num;
Inputs
ptr Specifies a pointer to memory allocated with XtMalloc(), XtCalloc(), or XtRealloc(), or NULL.
num Specifies the new number of bytes of memory desired in the block.
Returns
A pointer to allocated memory.
Description
XtRealloc() changes the size of the block of allocated memory pointed to by ptr to be at least num bytes large. In order to make this size
change, it may have to allocate a new block of memory and copy the contents of the old block (or as much as will fit) into the new block.
If it allocates a new block of memory, it frees the old block. In either case, it returns a pointer to a block of memory which is of the
requested size. If there is insufficient memory to allocate the new block, XtRealloc() terminates by calling XtErrorMsg().
If ptr is NULL, XtRealloc() simply calls XtMalloc() to allocate a block of memory of the requested size.
Usage
Note that XtRealloc() may move the contents of your allocated memory to a new location; the return value may or may not be the same as ptr.
Not all memory can be safely reallocated. If there are multiple pointers to a block of memory scattered through out an application (such
as pointers to a widget record), then reallocating that memory is not safe, because all pointers to it cannot be updated. Other memory
(such as the array of children maintained privately by the Composite widget class) can be safely updated because there should be only one
pointer to it in the application (in this case the pointer is the composite.children field of the widget). These cautions are no different
than those required with the standard realloc() function.
In most cases, you will have to cast the return value of XtRealloc() to an appropriate pointer type.
Note that because XtRealloc() behaves like XtMalloc() when passed a NULL pointer, (something that realloc() does not do), you don't have to
write special case code to allocate the first chunk of memory with XtMalloc() and subsequent chunks with XtRealloc(); you can simply use
XtRealloc() everywhere.
Memory allocated with XtRealloc() must be deallocated with XtFree(). The function XtRealloc() is implemented by the Toolkit independently
of the particular environment, so programs ported to a system not supporting malloc will still work.
See AlsoXtCalloc(1), XtFree(1), XtMalloc(1), XtNew(1), XtNewString(1).
Xt - Memory Allocation XtRealloc()