Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7874747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:51:52+00:00 2026-06-03T02:51:52+00:00

I have a school assignment where we are supposed to solve readers-writers problem. As

  • 0

I have a school assignment where we are supposed to solve readers-writers problem. As I found earlier sem_init is not supported on osx machine so I went with sem_open. However the code below does not work as expected.

if(sem_open(sem_reader, O_CREAT, 1, 0600) == SEM_FAILED)
    perror("sem_reader"); 

The semaphore IS created, but when I try to unlink it with following code:

if(sem_unlink(sem_reader) != 0)
    perror("unlink_sem_reader"); 

I get the output:

unlink_sem_reader: Permission denied

I tried to play with permissions like 0700, 0660 etc., but I always get permission denided. They are both wrapped in function and no action is taken with them. I am not sure where the problem is. My question is:

Did I set permissions incorrectly or the problem is somewhere else?

EDIT: Working in Xcode / 10.7

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T02:51:53+00:00Added an answer on June 3, 2026 at 2:51 am

    I think you switched arguments mode and value of sem_open.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an assignment for school, and I'm not sure how the teacher wants
I have an assignment from school where the program is supposed to close when
I have a small school assignment. My output is not correct. Can you see
I currently have a school assignment that involves both PHP and asp.net. Now the
For a school assignment I have to write x86 assembly code, except I can't
For a school assignment I have to create a C++ program that will create
Hello is have a question for a school assignment i need to : Read
I have to implement a search algorithm for a school assignment. Right now, i'm
For a database assignment I have to model a system for a school. Part
For a school assignment, we have to make a Usecase diagram. But the documentation

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.