From owner-freebsd-arch@FreeBSD.ORG Sun Jan 4 05:06:02 2015 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 341BDDB3; Sun, 4 Jan 2015 05:06:02 +0000 (UTC) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bbn0101.outbound.protection.outlook.com [157.56.111.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9CB1F3227; Sun, 4 Jan 2015 05:06:00 +0000 (UTC) Received: from BLUPR05CA0050.namprd05.prod.outlook.com (10.141.20.20) by BLUPR05MB433.namprd05.prod.outlook.com (10.141.27.140) with Microsoft SMTP Server (TLS) id 15.1.49.12; Sun, 4 Jan 2015 05:05:58 +0000 Received: from BL2FFO11FD039.protection.gbl (2a01:111:f400:7c09::108) by BLUPR05CA0050.outlook.office365.com (2a01:111:e400:855::20) with Microsoft SMTP Server (TLS) id 15.1.49.12 via Frontend Transport; Sun, 4 Jan 2015 05:05:58 +0000 Received: from P-EMF02-SAC.jnpr.net (66.129.239.16) by BL2FFO11FD039.mail.protection.outlook.com (10.173.161.135) with Microsoft SMTP Server (TLS) id 15.1.49.13 via Frontend Transport; Sun, 4 Jan 2015 05:05:58 +0000 Received: from magenta.juniper.net (172.17.27.123) by P-EMF02-SAC.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.146.0; Sat, 3 Jan 2015 21:05:56 -0800 Received: from idle.juniper.net (idleski.juniper.net [172.25.4.26]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id t0455sW41644; Sat, 3 Jan 2015 21:05:54 -0800 (PST) (envelope-from phil@juniper.net) Received: from idle.juniper.net (localhost [127.0.0.1]) by idle.juniper.net (8.14.4/8.14.3) with ESMTP id t0455dMr079659; Sun, 4 Jan 2015 00:05:39 -0500 (EST) (envelope-from phil@idle.juniper.net) Message-ID: <201501040505.t0455dMr079659@idle.juniper.net> To: Alfred Perlstein Subject: Re: Libxo bugs and fixes. In-Reply-To: <549F742D.3000802@mu.org> Date: Sun, 4 Jan 2015 00:05:39 -0500 From: Phil Shafer MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.16 as permitted sender) Authentication-Results: spf=softfail (sender IP is 66.129.239.16) smtp.mailfrom=phil@juniper.net; X-Forefront-Antispam-Report: CIP:66.129.239.16; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(199003)(164054003)(189002)(120916001)(50466002)(50986999)(110136001)(46102003)(64706001)(47776003)(21056001)(20776003)(105596002)(54356999)(48376002)(84676001)(86362001)(87936001)(6806004)(106466001)(99396003)(92566001)(31966008)(77156002)(53416004)(62966003)(76506005)(69596002)(81156004)(97736003)(68736005)(107046002)(77096005)(2950100001)(4396001); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR05MB433; H:P-EMF02-SAC.jnpr.net; FPR:; SPF:SoftFail; MLV:sfv; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-DmarcAction: None X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(3005003);SRVR:BLUPR05MB433; X-Forefront-PRVS: 0446F0FCE1 X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jan 2015 05:05:58.0665 (UTC) X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.16] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR05MB433 Cc: Marcel Moolenaar , John-Mark Gurney , Alfred Perlstein , "Simon J. Gerraty" , "arch@freebsd.org" , Poul-Henning Kamp , freebsd-arch , Konstantin Belousov X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jan 2015 05:06:02 -0000 Alfred Perlstein writes: >Solaris and glibc have a private libc function to check if a stream is >line buffered called int __flbf (FILE *stream) which returns true/false >if the stream if line buffered or not. I dislike using a non-standard function like this. I'd prefer the caller flag this information on the handle. There's already a flag one can set on a handle that will trigger a call to flush data buffered in the handle to the write function. I'll add a function to set a custom flusher, which will be called at appropriate times. Apps like netstat will know if they need iterative output, and can decide to set the XOF_FLUSH flag with a flusher callback. If needed, that callback can use __flbf. >One other topic, I talked to some webdevs and they suggested that we >have a "jsonLD" which stands for "json line delimited" that would be >useful for periodic output. This would be halfway between a "pretty >format" and a compact stream format. meaning that each line would be a >record, example: I can certainly add this, but the interesting issue would be how to form/reform the hierarchy surrounding the iterative output. Simplest case would be that the caller is resonsible for this, and the libxo just provides a flag to enable this and a function to say "this is a object". Thanks, Phil