tcgetpgrp(2) returns -1

Dear depelovers,

I made a simple program => http://privatepaste.com/15b2bacf7b

If I start it via gdb, gdb outputs:
    (gdb) r
    Starting program: /Users/fuuuuu/work/test
    1
    4476
    4476
    Program exited normally.

If I start it via lldb, lldb outputs:
    (lldb) r
    Process 4547 launched: '/Users/fuuuuu/work/test' (x86_64)
    1
    4547
    -1
    Inappropriate ioctl for device
    Process 4547 exited with status = 0 (0x00000000)

Is that LLDB's bug?

Best regards,
Tsukasa.

Hi Tsukasa,

Thanks for reaching out!

Can you provide us a bit of info to help us answer your question?

  1. Which OS did you build the test on? (MacOSX, Linux, FreeBSD, something else?)

  2. Is it a 32-bit or 64-bit system?

  3. Which compiler did you build your test with?

  4. Where did you get the lldb? (What does it say when you type ‘lldb --version’?)

Hopefully we can narrow down the issue once we have a bit more context.

Thanks!

-Todd

Hi Todd,

I'm sorry, I forgot to send important information.

1. Which OS did you build the test on? (MacOSX, Linux, FreeBSD, something else?)

on OS X 10.9.4

2. Is it a 32-bit or 64-bit system?

It's 64-bit system.

3. Which compiler did you build your test with?

I used clang. The version is below:

$ clang -v
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.3.0
Thread model: posix

4. Where did you get the lldb? (What does it say when you type 'lldb --version'?)

I installed lldb via "Command Line Tools (OS X Mavericks) for Xcode - April 2014",
which has been released by Apple. And the version is below:

$ lldb -v
lldb-310.2.37

Also, I tried lldb in Xcode 6 beta3, whose version is "lldb-320.4.106.2",
but the result didn't change.

Regards,
Tsukasa

2014/07/19 2:26、Todd Fiala <tfiala@google.com>:

Perfect, thanks! That’s exactly the info we needed.

-Todd