[Rxtx] Which Java folder in source?

iqzw2r602 at sneakemail.com iqzw2r602 at sneakemail.com
Tue Mar 1 15:07:46 MST 2011


What is this duplicating? A Unix port will need to call open() anyways (just
so we're talking about the same thing here: open() is the Unix equivalent of
CreateFile())

On Wed, Mar 2, 2011 at 3:55 AM, Adrian Crum
adrian.crum-at-sandglass-software.com |rxtx.org mailing list/Example Allow|
<ausj4cmytt at sneakemail.com> wrote:

>  That code duplicates what is in Dispatcher.cpp. A Unix port would only
> need to implement CommPortFactory::getInstance(portName, portType).
>
> -Adrian
>
>
> On 3/1/2011 4:37 AM, iqzw2r602 at sneakemail.com wrote:
>
>  JNIEXPORT jint JNICALL Java_name_pachler_nio_file_impl_Unix_open
>   (JNIEnv* env, jclass, jstring jpathname, jint flags, jint mode)
> {
>     const char* pathname = env->GetStringUTFChars(jpathname, 0);
>     if(pathname == 0)
>         return -1;    // java throws an out of memory error in this case
>     int result = open(pathname, flags, mode);
>     Unix_cacheErrno(); // handle interference between JVM and errno;
>     env->ReleaseStringUTFChars(jpathname, pathname);
>     return result;
> }
>
>
> _______________________________________________
> Rxtx mailing list
> Rxtx at qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qbang.org/pipermail/rxtx/attachments/20110302/45e9c314/attachment-0537.htm>


More information about the Rxtx mailing list