From owner-freebsd-hackers Wed Feb 20 19:41:24 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from swan.prod.itd.earthlink.net (swan.mail.pas.earthlink.net [207.217.120.123]) by hub.freebsd.org (Postfix) with ESMTP id 45C2937B400 for ; Wed, 20 Feb 2002 19:41:19 -0800 (PST) Received: from pool0050.cvx22-bradley.dialup.earthlink.net ([209.179.198.50] helo=mindspring.com) by swan.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16dk6e-00064p-00; Wed, 20 Feb 2002 19:41:16 -0800 Message-ID: <3C746C53.7CE5EB8B@mindspring.com> Date: Wed, 20 Feb 2002 19:41:07 -0800 From: Terry Lambert X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: "Lane, Frank L" Cc: "'freebsd-hackers@freebsd.org'" Subject: Re: Posix question References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG "Lane, Frank L" wrote: > I'm facing a serial write problem. Posix provides a function tcdrain () > that blocks until all serial data has been written from the card. Is there > an analogous function in the gnu c compiler for windows platforms? Does the > gnu c compiler try to give you posix functionality within the windows > environment? Thank you for any help you'll offer. This question really belongs on the "questions" mailing list -- and not the FreeBSD one, the one run by Microsoft. -- Are we talking serial devices here? The POSIX tcdrain only guarantees that the driver believes the data has been written; you still have a timing window in which the transmit FIFO will remain undrained, leaving a latency proportional to the FIFO depth divided by the baud rate. In Windows, there are serial operations that you can use to force the drain of the driver to the hardware, but, again, there is a tiny latency window because of the physical hardware. No, we don't wait until the transmit queue empty interrupt. This actually isn't a feature of the compiler, it's a feature of the libc you end up using. I think what you are looking for on Windows is called "CYGWIN32". No, it does not guarantee full POSIX compliance, and the license will impact your code's license. There are a couple of third party emulation layers; one of them is a Linux emulation for Windows, in fact... the company was acquired by Microsoft last year. So the answer is that you can buy it from Microsoft, if you want to avoid the license issue with CYGWIN32. Alternately, you can search for "POSIX" and "WINDOWS" in a search engine, and find the other companies out there. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message