I faced the same issue a few months ago and eventually found a good
alternative in Posix thread support. The routines to create and use the pthread_mutex_xxx() calls are available, but you will have to change your make file to include these linker options: -lpthread -lrt
Posix thread mutexes are actually better than process oriented mutexes in that they allow you to design multi-threaded applications.
What I do not like is the lack of full Posix real-time extensions, despite the "-lrt" option. The kernel was not built with real-time support, so priority inversion is an issue you must deal with as best you can. Careful thread design and thread priority setting helped address that issue for me.
Check out the full Posix API at:
http://pubs.opengroup.org/onlinepubs/9699919799/toc.htm
Regards, Mitch
--- In , "Clark" <> wrote:
>
> "#define _POSIX_THREAD_PROCESS_SHARED -1" in the libc in the ts7260-linux2.6-etch.dd.bz2 image, plus getting ENOSYS back from sem_open(blah,blah,blah,1) seems pretty conclusive. Yet I also get back ENOSYS from sem_open(blah,blah,blah,0) which doesn't seem right since _POSIX_SEMAPHORES is defined to be 200112L.
>
> There's a bunch of online posts about /dev/shm being not truly tmpfs, but rather ramfs ala CONFIG_TINY_SHMEM, and how config options can cause the ENOSYS. Tried many mounting options, no joy. Anyone else using named POSIX mutexes across processes in 2.6.21-ts, or have a clue? Thanks!
>
>
> The config file I am using sets:
>
> # General setup
> #
> CONFIG_LOCALVERSION=""
> # CONFIG_LOCALVERSION_AUTO is not set
> CONFIG_SWAP=y
> CONFIG_SYSVIPC=y
> CONFIG_IPC_NS=y
> CONFIG_SYSVIPC_SYSCTL=y
> CONFIG_POSIX_MQUEUE=y
> # CONFIG_BSD_PROCESS_ACCT is not set
> # CONFIG_TASKSTATS is not set
> # CONFIG_UTS_NS is not set
> # CONFIG_AUDIT is not set
> CONFIG_IKCONFIG=m
> CONFIG_IKCONFIG_PROC=y
> # CONFIG_SYSFS_DEPRECATED is not set
> # CONFIG_RELAY is not set
> CONFIG_BLK_DEV_INITRD=y
> CONFIG_INITRAMFS_SOURCE=""
> # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
> CONFIG_SYSCTL=y
> CONFIG_EMBEDDED=y
> CONFIG_UID16=y
> CONFIG_SYSCTL_SYSCALL=y
> CONFIG_KALLSYMS=y
> CONFIG_KALLSYMS_EXTRA_PASS=y
> CONFIG_HOTPLUG=y
> CONFIG_PRINTK=y
> # CONFIG_BUG is not set
> # CONFIG_ELF_CORE is not set
> CONFIG_BASE_FULL=y
> CONFIG_FUTEX=y
> CONFIG_EPOLL=y
> CONFIG_SHMEM=y
> CONFIG_SLAB=y
> # CONFIG_VM_EVENT_COUNTERS is not set
> CONFIG_RT_MUTEXES=y
> # CONFIG_TINY_SHMEM is not set
> CONFIG_BASE_SMALL=0
> # CONFIG_SLOB is not set
>
> and
>
> #
> # Pseudo filesystems
> #
> CONFIG_PROC_FS=y
> CONFIG_PROC_SYSCTL=y
> CONFIG_SYSFS=y
> CONFIG_TMPFS=y
> CONFIG_TMPFS_POSIX_ACL=y
> # CONFIG_HUGETLB_PAGE is not set
> CONFIG_RAMFS=y
> # CONFIG_CONFIGFS_FS is not set
>