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 8960799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:44:24+00:00 2026-06-15T15:44:24+00:00

System: Ubuntu 12.04 Compiler: gcc (version: 4.6.3) My idea is to write a client-server

  • 0

System: Ubuntu 12.04
Compiler: gcc (version: 4.6.3)

My idea is to write a client-server application to exchange data via the serial port.

But my problem is, when I execute the code-snippet below, open returns the same file descriptor
if I start two independent processes:

The first process opens “/dev/ttyS0”.
The 2nd process opens “dev/ttyS1”.

    ....
    serialPortDescriptor = open(portName,
                                O_RDWR | O_NOCTTY | O_NDELAY | O_EXCL);
if (serialPortDescriptor == INVALID_SERIALPORT_DESCRIPTOR) {
    return SERIALPORT_UNKNOWN_ERROR;
}
    .....

Is it normal that open returns the identical file descriptor value for different devices/pathnames (“dev/ttyS1” and “dev/ttyS0” respecively) in two different processes/programs?

  • 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-15T15:44:25+00:00Added an answer on June 15, 2026 at 3:44 pm

    It’s totally normal. File descriptor is just an offset into in-kernel per-process open file table.

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

Sidebar

Related Questions

I am running Ubuntu Server 12.04 LTS as the guest operating system. How many
I'm trying to call the system call write with the inline assembler (gcc 4.2.1,
I have been experimenting with Objective-C using GCC + GNUstep on an Ubuntu system.
I've created a C program to write to a serial port (/dev/ttyS0) on an
I would like to disable address space layout randomization (ASLR) on my system (Ubuntu
my system is Ubuntu 10 here is my code: #!/bin/bash pid = `ps -ef
My system is Ubuntu 11.10. I've been following this guide somewhat: http://www.ozbotz.org/opencv-installation/ I also
I have installed KVM on my Ubuntu system. Using vmbuilder , I setup a
I have a problem with apache2 settings (Ubuntu system). I would like to run
I´ve got a nomral user called Teacher in my Ubuntu system and it has

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.