Sponsored Content
Full Discussion: Standard UNIX functions
Top Forums Programming Standard UNIX functions Post 302290439 by Zipi on Monday 23rd of February 2009 09:37:30 AM
Old 02-23-2009
Standard UNIX functions

Hi everybody,
first of all i apologize if my thread's title doesn't make much sense,but i coudn't find a more appropriate name Smilie
Then i apologize about my question,which probably will sound trivial for you Smilie Smilie

I am working on a program which is being tested in Linux but the final target is a VxWorks system.
So far,i am in the test phase,so i'm fighting ( Smilie ) with linux.Since I am a newbie to unix programming,every time i use some new library functions i wonder:will it be supported in VxWorks?
Now i ask you:is there a common set of libraries for the various unices? Obviously my attention i concentrated on the linux-vxworks couple,but any advice is welcome

Thanks in advance!
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Which DVD standard I can use for UNIX???

Hi there, I just want to know what is the best DVD-writer & software I can use is PC, but I want to be able to read it from Unix. I tried to burn a DVD from my friend DVD-writer, when I try to read it in Unix the name of the file all mixed up. I'm not that familiar with DVD standard and which... (1 Reply)
Discussion started by: geoquest
1 Replies

2. Shell Programming and Scripting

Coding Standard For Unix Shell Scripting!!!

Is there any site on Coding Standard for Shell Scripting in UNIX. Please help me know!!!!! Thanks Om (1 Reply)
Discussion started by: Omkumar
1 Replies

3. Programming

Similar functions in unix

Hi, I am windows programer. I have very basic knowledge of Unix OS. I have written an application in Windows which consists of Win32 API namely WideCharToMultiByte(..) and MultiByteToWideChar(..). I am interested to deploy my application in unix platform henceforth I need to know IS... (1 Reply)
Discussion started by: dayakarr
1 Replies

4. Programming

using c++ and c standard I/O functions

Is it not a healthy practice to mix C and C++ standard I/O functions together e.g. string name; // this is a declared instance of the string class in C++ printf("\nPlease enter your name: "); cin >> name; I did something similar in a program Im designing, and used it several... (1 Reply)
Discussion started by: JamesGoh
1 Replies

5. UNIX for Dummies Questions & Answers

unix functions

Hi All, i have two functions in my script. question() { num=`ps -e | grep ps | awk -F" " '{print $1}'` qno=`expr $num % 10` grade=grade1 cat grade1/$qno answer ${grade} ${qno} } answer() { grade=$1 qno=$2 ansno=`wc -l $grade/ans/$qno | cut -d' ' -f1` j=0 while do (1 Reply)
Discussion started by: Usha Shastri
1 Replies

6. Shell Programming and Scripting

Recursive functions in Unix

Hi Guys, Is there a way to write a recursive function in unix? Thanks for your help in advance, Regards, Magesh. (1 Reply)
Discussion started by: mac4rfree
1 Replies

7. UNIX for Dummies Questions & Answers

Redirect Standard output and standard error into spreadsheet

Hey, I'm completely new at this and I was wondering if there is a way that I would be able to redirect the log files in a directories standard output and standard error into and excel spreadsheet in anyway? Please remember don't use too advanced of terminology as I just started using shell... (6 Replies)
Discussion started by: killaram
6 Replies

8. AIX

Unix 64-bit AIX V6.1 Standard Edition

Unix 64bit AIX v6.1 standard edition what do you mean ? function ? pls, help me... (1 Reply)
Discussion started by: khanhphv
1 Replies

9. Shell Programming and Scripting

How to execute functions or initiate functions as command line parameters for below requirement?

I have 7 functions those need to be executed as command line inputs, I tried with below code it’s not executing function. If I run the ./script 2 then fun2 should execute , how to initiate that function I tried case and if else also, how to initiate function from command line if then... (8 Replies)
Discussion started by: saku
8 Replies

10. Programming

Newline in ANSI-C standard functions

Can someone outline the "best practice" (if any!) to handle newline in ANSI-C standard library functions? I had some confusion with these functions recently related to char array and char pointer. puts(), printf(), strcpy(), strncpy(), memset(). I seem to understand their basic use, but got... (6 Replies)
Discussion started by: yifangt
6 Replies
erl_set_memory_block(3erl)					C Library Functions					erl_set_memory_block(3erl)

NAME
erl_set_memory_block - Custom memory allocation for Erlang on VxWorks(R) DESCRIPTION
This documentation is specific to VxWorks. The erl_set_memory_block function/command initiates custom memory allocation for the Erlang emulator. It has to be called before the Erlang emulator is started and makes Erlang use one single large memory block for all memory allocation. The memory within the block can be utilized by other tasks than Erlang. This is accomplished by calling the functions sys_alloc , sys_real- loc and sys_free instead of malloc , realloc and free respectively. The purpose of this is to avoid problems inherent in the VxWorks systems malloc library. The memory allocation within the large memory block avoids fragmentation by using an "address order first fit" algorithm. Another advantage of using a separate memory block is that resource reclamation can be made more easily when Erlang is stopped. The erl_set_memory_block function is callable from any C program as an ordinary 10 argument function as well as from the commandline. EXPORTS
int erl_set_memory_block(size_t size, void *ptr, int warn_mixed_malloc, int realloc_always_moves, int use_reclaim, ...) The function is called before Erlang is started to specify a large memory block where Erlang can maintain memory internally. Parameters: size_t size : The size in bytes of Erlang's internal memory block. Has to be specified. Note that the VxWorks system uses dynamic memory allo- cation heavily, so leave some memory to the system. void *ptr : A pointer to the actual memory block of size size . If this is specified as 0 (NULL), Erlang will allocate the memory when starting and will reclaim the memory block (as a whole) when stopped. If a memory block is allocated and provided here, the sys_alloc etc routines can still be used after the Erlang emulator is stopped. The Erlang emulator can also be restarted while other tasks using the memory block are running without destroying the memory. If Erlang is to be restarted, also set the use_reclaim flag. If 0 is specified here, the Erlang system should not be stopped while some other task uses the memory block (has called sys_alloc ). int warn_mixed_malloc : If this flag is set to true (anything else than 0), the system will write a warning message on the console if a program is mix- ing normal malloc with sys_realloc or sys_free . int realloc_always_moves : If this flag is set to true (anything else than 0), all calls to sys_realloc result in a moved memory block. This can in certain conditions give less fragmentation. This flag may be removed in future releases. int use_reclaim : If this flag is set to true (anything else than 0), all memory allocated with sys_alloc is automatically reclaimed as soon as a task exits. This is very useful to make writing port programs (and other programs as well) easier. Combine this with using the routines save_open etc. specified in the reclaim.h file delivered in the Erlang distribution. Return Value: Returns 0 (OK) on success, otherwise a value <> 0. int erl_memory_show(...) Return Value: Returns 0 (OK) on success, otherwise a value <> 0. int erl_mem_info_get(MEM_PART_STATS *stats) Parameter: MEM_PART_STATS *stats : A pointer to a MEM_PART_STATS structure as defined in <memLib.h> . A successful call will fill in all fields of the structure, on error all fields are left untouched. Return Value: Returns 0 (OK) on success, otherwise a value <> 0 NOTES
The memory block used by Erlang actually does not need to be inside the area known to ordinary malloc . It is possible to set the USER_RESERVED_MEM preprocessor symbol when compiling the wind kernel and then use user reserved memory for Erlang. Erlang can therefor uti- lize memory above the 32 Mb limit of VxWorks on the PowerPC architecture. Example: In config.h for the wind kernel: #undef LOCAL_MEM_AUTOSIZE #undef LOCAL_MEM_SIZE #undef USER_RESERVED_MEM #define LOCAL_MEM_SIZE 0x05000000 #define USER_RESERVED_MEM 0x03000000 In the start-up script/code for the VxWorks node: erl_set_memory_block(sysPhysMemTop()-sysMemTop(),sysMemTop(),0,0,1); Setting the use_reclaim flag decreases performance of the system, but makes programming much easier. Other similar facilities are present in the Erlang system even without using a separate memory block. The routines called save_malloc , save_realloc and save_free provide the same facilities by using VxWorks own malloc . Similar routines exist for files, see the file reclaim.h in the distribution. Ericsson AB erts 5.8.3 erl_set_memory_block(3erl)
All times are GMT -4. The time now is 10:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy