From owner-freebsd-questions@FreeBSD.ORG Mon Jul 27 13:48:45 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75CD7106566C for ; Mon, 27 Jul 2009 13:48:45 +0000 (UTC) (envelope-from andrewlylegould@gmail.com) Received: from mail-fx0-f214.google.com (mail-fx0-f214.google.com [209.85.220.214]) by mx1.freebsd.org (Postfix) with ESMTP id F22308FC1A for ; Mon, 27 Jul 2009 13:48:44 +0000 (UTC) (envelope-from andrewlylegould@gmail.com) Received: by fxm10 with SMTP id 10so116595fxm.43 for ; Mon, 27 Jul 2009 06:48:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=siSj9OYY+C4ybjEtLm62bmZ6Z+WQWMOjSaTTYb3ON4Q=; b=mFSk+z9kgjF0ASWT338xbFVkK/D20VihRbsc+56sAqWIKyf6qbJBLRY7J6L00Jb6i6 jg0gRdTrOM41hQzs2rddTKfEosWGbsKo0viCjMfDOQN4HeYiRfsZKeZDgYYPDodEi8Yx Eo3VGb2ARQCtZnuQ4+DssiVF3u77PotEvgjaA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=NhqI0ZKwwXlz8U2P1I7qInrYdI77ZxR1TLiTAPoylOqJZtypl1/OaGu29F2XnTTfw+ AiEkZYeT6Dh2i6RbR2w8UElDYvjhgxJhbw0IFutQuJbBCOArozwHoqsnsg7bqq8RCvKs S5GoNS2srRFMKicCa9Uz93DAUivRP5xFpGpoQ= MIME-Version: 1.0 Received: by 10.223.108.78 with SMTP id e14mr2622051fap.88.1248702523580; Mon, 27 Jul 2009 06:48:43 -0700 (PDT) In-Reply-To: <771031.86846.qm@web57007.mail.re3.yahoo.com> References: <771031.86846.qm@web57007.mail.re3.yahoo.com> Date: Mon, 27 Jul 2009 08:48:43 -0500 Message-ID: From: Andrew Gould To: Unga Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: How to find what symlink points to? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2009 13:48:45 -0000 On Mon, Jul 27, 2009 at 8:45 AM, Unga wrote: > > --- On Mon, 7/27/09, Erik Trulsson wrote: > >> From: Erik Trulsson >> Subject: Re: How to find what symlink points to? >> To: "Unga" >> Cc: freebsd-questions@freebsd.org >> Date: Monday, July 27, 2009, 9:36 PM >> On Mon, Jul 27, 2009 at 05:44:59AM >> -0700, Unga wrote: >> > >> > Hi all >> > >> > I need to remove some unwanted symlinks on /dev using >> a C program. >> > >> > The "struct dirent" only shows the symlink name, how >> do I find what that >> > symlink points to for verification purpose? >> >> By using the readlink(2) system call. >> > > But readlink(2) fails with errno set to 2. Can readlink(2) use with dev nodes? > > Unga > Doesn't 'ls -alh' provide that information? Andrew