Hi! good morning!
I am writing a program, that uses interaction between 5 processes(using signals), I am trying to use in one of them- gets command to get a command from the user.
And it seems that gets isn't working..
Maybe one of the other processes interrupts the work of gets command?

what can I do?

thank you!!

Recommended Answers

All 2 Replies

use sigaction to capture the signal to check what signal is interrupting the gets method. If you handle the signal using sigaction, it should also fix your current issue.

You should never use gets() anyway because it could cause buffer overflow errors. Use fgets() instead.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.