From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q2KHpMX7020324 for ; Tue, 20 Mar 2012 18:51:22 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApcBAPjCaE9KfVI0kGdsb2JhbABEtlsIIgEBAQEJCQ0HFAQjgiICExMGARsEGgMSbhEBBQFXh2gElnuCXQqME4JxhSk/iHYBBQuNVII/YwSVXgGOSD2ECg X-IronPort-AV: E=Sophos;i="4.73,619,1325458800"; d="scan'208";a="150404145" Received: from mail-wg0-f52.google.com ([74.125.82.52]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 20 Mar 2012 18:51:17 +0100 Received: by wgbgn7 with SMTP id gn7so206387wgb.9 for ; Tue, 20 Mar 2012 10:51:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:mail-followup-to:mime-version :content-type:content-disposition; bh=Hkxgu8uH61F632+s2nG1WMpIeyq+apI3998iRen4Pws=; b=rP6x0vfsFMfRNYBCMoqroW5CnOsDr/WkGJ/mhYzqWzhPZXHvFec4RjZMlJ/y3w6Sut F7bPDrxr3bdh9xUGuslnIC/OM6St1UZI0xEudsRSoS61Pz/DzaePOSOf/4qQT6lcROeY TKbbyhgWuxjJkOQICNvhJwNHSg1tYKdOzI8TPk7H7DeaOQX1ykcxwvDXiEKIfYJhzaRx Gba/7EXzmgolX65CW68dl5Yoh3PCntjqtK/SrVut12Pc9u6apFA+Ot4E+IACzUKWCxb2 wkaYGbmfZOunS+UKgkYhNFv7uD/wvuty0wlJogztNIU0ovAkF3jhhqbueA3JyJZSPjNm 8/Hw== Received: by 10.180.107.164 with SMTP id hd4mr30711013wib.18.1332265876714; Tue, 20 Mar 2012 10:51:16 -0700 (PDT) Received: from localhost (197.Red-79-159-35.staticIP.rima-tde.net. [79.159.35.197]) by mx.google.com with ESMTPS id n8sm9097266wix.10.2012.03.20.10.51.14 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 20 Mar 2012 10:51:15 -0700 (PDT) Date: Tue, 20 Mar 2012 18:51:13 +0100 From: Ricardo Catalinas =?iso-8859-1?Q?Jim=E9nez?= To: caml-list@inria.fr Message-ID: <20120320175113.GC935@viper.local> Mail-Followup-To: caml-list@inria.fr MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Caml-list] Unix.getlogin () fails when stdin is redirected I found out the next issue in this simple code: let () = print_endline "Hello"; print_endline (Unix.getlogin ()) Running in the normal case, with `./a.out' gives: Hello ricardo But running like `./a.out ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, 0x7fff12682c98) = -1 ENOTTY (Inappropriate ioctl for device) write(2, "Fatal error: exception Unix.Unix"..., 59) = 59 exit_group(2) = ? Any idea how to fix this? Best regards -- Ricardo (http://r.untroubled.be/)