redkrzy
BAN USERthe simplest would be
char *strcpy(char *dst, const char *src)
{
char *rettmp = dst; ///return pointer
///pointer and len must have being validated prior invoking this function
while ((*dst++ = *src++) != '\0')
/* nothing needs to be done, sometimes compiler optimizations can create problem but most versions of the gcc works fine*/;
return rettmp;
}
As the question clearly states "one or many process try to access the queue"?
This support can be provided by Semaphore as it allows multiple process to enter and read the contents. And we can use "Mutex" which is kind of binary semaphore for writing.
Once the "Semaphore" count is zero one of the process can claim the "mutex" and write.
Another question arises of "concurrency" which can be handled different ways check out linux RCU (Read-Copy-Update) on similar lines.
for ARM process,
- redkrzy April 05, 2013you will have the system call number in r6 (as per EABI)
then a software interrupt SWI will be raised
The context will stored.
Then the respective system call will be serviced.
Once it is serviced the context will be restored and returned to the application.