On Wed, 30 Aug 2023, Brook Milligan wrote:

I am trying to communicate with uart4 on a Beaglebone Black, but cannot open 
/dev/tty01; open(2) just hangs.

[...]
#ls -l /dev/tty01
crw-------  1 uucp  wheel  12, 1 Apr 11 12:20 /dev/tty01

However, when run by root, the following code just hangs, i.e., the open() 
never returns.

        #include <fcntl.h>
        int main ()
        {
          int fd;
          char const* filename = "/dev/tty01";
          fd = open(filename,O_RDWR);
        }


If you open a dial-in device without O_NONBLOCK, then open() won't return until
the carrier is asserted. Does Ctrl-C (or kill -9) end the program?

-RVP

Reply via email to