9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Anthony Martin <ality@pbrane.org>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] /dev/draw and c, rc, ruby, python, go
Date: Sun, 10 Apr 2011 17:49:02 -0700	[thread overview]
Message-ID: <20110411004902.GA13057@dinah> (raw)
In-Reply-To: <BANLkTikQF2=qizJiMPv_u7ViviLA2j66Lw@mail.gmail.com>

Sergey Kish <sergey.kish@gmail.com> once said:
> Today I've implemented same on go. It also falls but it may be my
> fault
>
>     error: read /dev/draw/new: unknown id for draw image

You're giving bad data to devdraw.  The Go code on the gist
is sending

	long(id) 'n' long(id) byte(namelen) string(name)

but that first long will cause the write to fail.  Also,
you should really check the errors from any system call
instead of discarding them.  The error from the read is
a red herring in this case (but still expected because
the named image allocation failed).

Now for the Python and Ruby code, I really have no idea.
I would check to see if their standard library requires
that you flush after writes.

Hope that helps.

  Anthony



  parent reply	other threads:[~2011-04-11  0:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-10 17:53 Sergey Kish
2011-04-10 20:49 ` ron minnich
2011-04-12  4:41   ` Akshat Kumar
2011-04-13 22:16     ` erik quanstrom
2011-04-11  0:49 ` Anthony Martin [this message]
2011-04-11  1:09   ` Anthony Martin
2011-04-11 15:17     ` Sergey Kish

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110411004902.GA13057@dinah \
    --to=ality@pbrane.org \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).