Okay, thanks for the explanation. 2013/6/10 Joerg Wunsch <[email protected]>
> As Anton Smirnov wrote: > > > > Frankly: I don't know. > > > Can you say what is required (compile params, flags, etc..) exactly? > > I think i will have to ask for it from android engineers or smth. > > It's the POSIX (“Single UNIX Specification”, SUS) API calls > tcgetattr()/tcsetattr(), in whatever way they might be implemented. > > If it's really just the isatty() call but the actual calls to > tcsetattr()/tcgetattr() would work, it's certainly safe to must remove > the isatty() test. The meaning of “terminal” is not very strictly > defined in SUS, but if a descriptor returns a failure for isatty() but > can successfully modified via tcsetattr(), this would for sure be > somewhat self-contradictional. > > OTOH, dropping the isatty() check is safe: when trying to apply the > serial port operations to a non-tty descriptor, they are supposed to > fail anyway, so it's not important to check the descriptor for > belonging to a terminal device beforehand. > Okay, since i'm completely in stuck with it i have to try just comment/remove isatty() check. > > > > Btw., there's no real need to pass the descriptor along a socket, you > > > could as well pass it through a commandline option and just bypass the > > > open(). > > > Not sure that's true. AFAIK file descriptor is process-related and it > means > > nothing in context of another process > > If it follows the UNIX process model, file descriptors inherited > after a fork() are supposed to be the same, I think. SUS says > (in the description of fork()): > > “The child process shall have its own copy of the parent's file > descriptors. Each of the child's file descriptors shall refer to the > same open file description with the corresponding file descriptor of > the parent.” > > Of course, a foreign descriptor outside of a child process makes no > sense, but inside a child process, it's supposed to work. (File > descriptors are mandated to be small integer numbers, where “small” > refers to the requirement that each call that returns a new open > descriptor actually returns the smallest number that is not currently > open for that particular process.) > > (If it doesn't follow the UNIX process model, things are of course > different.) > Well, now the question is "does android (linux) follow UNIX Process model or not?". Do you think i have to just pass file descriptor as int and just skip using socket? > -- > cheers, Joerg .-.-. --... ...-- -.. . DL8DTL > > http://www.sax.de/~joerg/ > Never trust an operating system you don't have sources for. ;-) > > _______________________________________________ > avrdude-dev mailing list > [email protected] > https://lists.nongnu.org/mailman/listinfo/avrdude-dev > _______________________________________________ avrdude-dev mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/avrdude-dev
