From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED, USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E24B7C43381 for ; Sat, 2 Mar 2019 07:50:57 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8F8552083D for ; Sat, 2 Mar 2019 07:50:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kroah.com header.i=@kroah.com header.b="LHP3ANXR"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="b/tBGqH3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8F8552083D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kroah.com Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.91) (envelope-from ) id 1gzzPY-0000wO-SI; Sat, 02 Mar 2019 02:50:20 -0500 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1gzzPW-0000vf-HS for kernelnewbies@kernelnewbies.org; Sat, 02 Mar 2019 02:50:19 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 64AC534B2; Sat, 2 Mar 2019 02:50:10 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Sat, 02 Mar 2019 02:50:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=yYaNcLH1MBjiAcW7Wz61qfLSTVA pHKrYz9vDLTUB8UA=; b=LHP3ANXRBoZj90AZUqqrgTVZ0hO9wgf9C8UJU08qwUW aUM0JdFSXjsCiNHg3UOEv0Ftr3ZegJm4LSF5TN4qVUSgAEPwMOxzhQfEP+/9B8fJ b1YWAsa9nL4SCUCa8oY+8pkn94VLHkHoa6qxKEtEjawnfpUQndU33C5zviESMK28 uAiyCS1Y9daaJIzly248kudyVFDPpsv73xk5NFrV5RT6S0/pZAe9/I32obQJ5YaO pf78eOnqlomU8uGAhkJGKK5/AgYNLprR2q/pMVEO7XwCrPB4u75M9q8kkWBnWUIT IDflXEYYCATELy9DZx5qmRLbjBEMNQqqHlc7rcXHP7A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=yYaNcL H1MBjiAcW7Wz61qfLSTVApHKrYz9vDLTUB8UA=; b=b/tBGqH3W0mHN42PxzmmT4 viBb/Bavcy2TxI/hSwUz/ixAne8EphfNqRQhXwmt4tYe/MpRx49bRqyx2BBpTJ9k UPT28vqh4QTAizVOV2JxLtyLburNxsuKi4ixZfDP8NGXjPq4GUCVUW8MRtg6ZqG2 N7so4Wf0Zg5UCCSLTMN7zc2xrRdWZCCAagWPo4cL+y72sxodWHgizfzhxsof8VBV cF5p9SoSeNbjpfQKG3HO/jVA8Hi/bKULrstJE8AOJT1Yp3CkgoMd6/JpfnvorZN8 mpzlXJhoovh1QkeN+0EIdrE9aj408IIlrTMi17GEexyhRiR8PSWfeFSoVz1nq6nQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrvdeigdduuddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkfhggtggujggfsehttd ertddtredvnecuhfhrohhmpefirhgvghcumffjuceoghhrvghgsehkrhhorghhrdgtohhm qeenucfkphepkeefrdekiedrkeelrddutdejnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hgrhgvgheskhhrohgrhhdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from localhost (5356596b.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id 21DDF10312; Sat, 2 Mar 2019 02:50:09 -0500 (EST) Date: Sat, 2 Mar 2019 08:50:07 +0100 From: Greg KH To: Jeffrey Walton Subject: Re: How to make /dev/ttyACM0 (and friends) exclusive? Message-ID: <20190302075007.GB16604@kroah.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) Cc: kernelnewbies X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org On Fri, Mar 01, 2019 at 11:29:53PM -0500, Jeffrey Walton wrote: > Hi Everyone, > > I'm trying to trackdown a problem using my dialup modem. I have a > program that opens the modem and watches caller id's. It flashes the > hook when a telemarketer calls. It works well until... > > When another program opens the modem then my program starts reading > intermittent responses intended for the other program. > > I cannot seem to open the device in exclusive mode. The current open > is (I also tried with O_EXCL): > > int modem = open(device_path, O_RDWR | O_NOCTTY | O_SYNC); > > I'm not sure if it because udev configures the device incorrectly or > the kernel driver is configured incorrectly. Or maybe it is impossible > to do. This isn't a kernel thing, it is a userspace configuration issue. Just change the permissions of the device node such that only your one program can open it. Or, once you open it, change the permissions such that no one else can open it. Or better yet, uninstall modem manager, that's what is probably opening up the device at random points in time :) good luck! greg k-h _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies