DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 21st April 2020
rorys rorys is offline
Real Name: Rory
New User
 
Join Date: Apr 2020
Location: Colorado, USA
Posts: 6
Default Sending Signals Between Processes Owned by Different Users

Hello,

I have a small chat program I'm working on (in C), which attaches to some shared memory, where it will write/read all the messages. I'm using interrupts to wake up all the other clients when one client sends a message to the shared memory (this way all the other clients will read the memory and display the message). My problem is, processes owned by one user cannot send signals to a process owned by a different user (unless the user sending signals is root of course). So, is there anyway in OpenBSD to allow processes owned by two different users to send signals to eachother? In Linux, I know there is something called libcap, which allows setting the file capabilities of a binary; could there be anything similar in OpenBSD? Thanks!
Reply With Quote
  #2   (View Single Post)  
Old 21st April 2020
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

Hello, and welcome!


Have you considered TCP sockets? I believe that's what talk(1) uses.
Reply With Quote
  #3   (View Single Post)  
Old 22nd April 2020
rorys rorys is offline
Real Name: Rory
New User
 
Join Date: Apr 2020
Location: Colorado, USA
Posts: 6
Default

Aren't TCP sockets blocking, though? I'm trying not to use polling if at all possible, since it would eat up a lot of CPU time if there aren't many messages being sent.

Also, thanks for the welcome!
Reply With Quote
  #4   (View Single Post)  
Old 22nd April 2020
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

OpenBSD has System V IPCS shared memory tools, but I have never tried to program with them and don't know their limitations or restrictions. See ipcs(1), ipcrm(1), shmctl(2), shmget(2), shmat(2), ...
Reply With Quote
  #5   (View Single Post)  
Old 22nd April 2020
e1-531g e1-531g is offline
ISO Quartermaster
 
Join Date: Mar 2014
Posts: 628
Default

TCP sockets may be non-blocking, see socket(2).
Quote:
SOCK_NONBLOCK Set non-blocking I/O mode on the new socket.
__________________
Signature: Furthermore, I consider that systemd must be destroyed.
Based on Latin oratorical phrase
Reply With Quote
  #6   (View Single Post)  
Old 22nd April 2020
rorys rorys is offline
Real Name: Rory
New User
 
Join Date: Apr 2020
Location: Colorado, USA
Posts: 6
Default

I will look into IPCS tools some more and see if it has any utilities for setting permissions regarding signals. I'll also take a look at sockets then if I have no look with IPCS. I did not realize sockets could be non-blocking.

Thanks everyone for the replies !
Reply With Quote
Reply

Tags
clang, interrupts, multi-user, signals


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Other Startpage is now owned by an advertising company e1-531g News 3 12th November 2019 03:14 PM
Courier IMAP - ccount's mailbox directory is not owned by the correct uid or gid Torxed OpenBSD General 5 3rd July 2013 09:22 PM
Misc. BSD/UNIX Oracle Signals an End to OpenSolaris Android1 News 2 15th August 2010 06:29 PM
See processes on other servers? biscuits FreeBSD General 2 20th January 2009 04:15 AM
chmods for users & hiding processes mike OpenBSD Security 2 12th June 2008 04:15 PM


All times are GMT. The time now is 09:31 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick