| delorie.com/archives/browse.cgi | search |
| X-Recipient: | archive-cygwin AT delorie DOT com |
| DomainKey-Signature: | a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id |
| :list-unsubscribe:list-subscribe:list-archive:list-post | |
| :list-help:sender:date:from:to:cc:subject:message-id:reply-to | |
| :references:mime-version:content-type:in-reply-to; q=dns; s= | |
| default; b=Il5mPXM3rWItm5LZYK9nfCl6FZwMqkDyPVOHQaPRmWhIz4HJvHJEX | |
| sLm2pK1MxpJUSAwj3QAyK/KBX608R3W/XKBNqcZ9H2sn7LF7Aajy6DxZnq+dQMxE | |
| cd7YKAGnBP2ITpU+pb4jco+wJLJo50j5CKYtxHe5U/hd9uyRuPvns4= | |
| DKIM-Signature: | v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id |
| :list-unsubscribe:list-subscribe:list-archive:list-post | |
| :list-help:sender:date:from:to:cc:subject:message-id:reply-to | |
| :references:mime-version:content-type:in-reply-to; s=default; | |
| bh=tVmYwky+gxq5b2N7I29WdYEg7yk=; b=T1pgt48mF/DW3qAH3XDav664hW3t | |
| LDy2RXdCZ6oQxJ5YGdKzJLHgk8NpB0V76jsWOa9emFvWicthRBB78+wMZ6VPOQmj | |
| DZC6LrBpWT3r+5XW9A7npJqI3Tu6JXQVqkWDX0+SXeogewPuL8kxswz5UlA7SWuy | |
| rnhZKrM6LK2ztFw= | |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Id: | <cygwin.cygwin.com> |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sourceware.org/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
| Sender: | cygwin-owner AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| Delivered-To: | mailing list cygwin AT cygwin DOT com |
| Authentication-Results: | sourceware.org; auth=none |
| X-Spam-SWARE-Status: | No, score=-103.3 required=5.0 tests=AWL,BAYES_00,GOOD_FROM_CORINNA_CYGWIN,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=onboard |
| X-HELO: | mout.kundenserver.de |
| Date: | Mon, 16 Dec 2019 11:21:08 +0100 |
| From: | Corinna Vinschen <corinna-cygwin AT cygwin DOT com> |
| To: | Ulli Horlacher <framstag AT rus DOT uni-stuttgart DOT de> |
| Cc: | cygwin AT cygwin DOT com |
| Subject: | Re: non-persistant storage? |
| Message-ID: | <20191216102108.GN10310@calimero.vinschen.de> |
| Reply-To: | cygwin AT cygwin DOT com |
| Mail-Followup-To: | Ulli Horlacher <framstag AT rus DOT uni-stuttgart DOT de>, cygwin AT cygwin DOT com |
| References: | <20191212120041 DOT GA7699 AT tik DOT uni-stuttgart DOT de> |
| MIME-Version: | 1.0 |
| In-Reply-To: | <20191212120041.GA7699@tik.uni-stuttgart.de> |
--l+goss899txtYvYf
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Hi Ulli,
On Dec 12 13:00, Ulli Horlacher wrote:
> I need to store some data (a few kB) non-persistant.
> On a real UNIX I would use /var/run, because after a shutdown all its
> content is lost.
> But on cygwin /var/run is stored on disk.
>=20
> I cannot use an environment variable, because different processes need to
> read/write the data.
>=20
> /proc is non-persistant (in respect to a reboot), but It is not a generic
> storage place.
>=20
> What can I use with cygwin instead?
>=20
> Installing third party software is not an option, it must work with a
> standard Windows (and cygwin).
Cygwin is just a user space DLL, it's not an OS. Creating RAM disk-like
storage is the job of the OS or an OS driver. Unfortunately, there's no
onboard RAM disk driver in Windows, just zillions of third-party solutions.
I see two options:
- Use XSI shared memory, as outlined in this thread already, or
- If you have the executables under source control, you can use
an O_TMPFILE on /dev/shm, and fork the worker process from there,
i.e.
fd =3D open ("/dev/shm", O_TMPFILE | O_RDWR, S_IRUSR | S_IWUSR);
if (fd >=3D 0)
{
write (fd, your_key, strlen (your_key));
switch (fork ())
{
case 0: /* child */
/* Use fd as you see fit */
break;
case -1: /* error */
default: /* parent */
close (fd);
wait (&status);
break;
}
}
Corinna
--=20
Corinna Vinschen
Cygwin Maintainer
--l+goss899txtYvYf
Content-Type: application/pgp-signature; name="signature.asc"
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAl33WpQACgkQ9TYGna5E
T6BNnQ//a4p66QL5GMxQNm65h+fOdI+wuSeQDN+0VnF3JjglLZQm1pyGhLv6EXQX
9gyZofpXY8tCp7007tRLndAFfs6k1bSPuuFib1sMwFrzelUpqXgeA21jzk95B5X8
1p5Yq2fNAbE0qGI1F3kvOZKi1jS/20I9Ts4ANi4FVj5WJI76B7siXZREdRB2i6yI
mgz6Y3uVMZpQmzIDsncQ5YCBO3TB//cfbY6Nv44kjcpVBsH8JRk3aMi0NCz2OHsu
yIf3oYjKGhImZUYH3PSA4MJpTVNqnR9vnwIpLgc+FfR2S8OQ7s/23oP1gRCEp23/
o3zj1YsY5p/8Wdw9V3BoZWfnrX/XaJBLDm1zuwBQlWX/PxQG9OlsV6O6MvYcjeMS
a/bgAVaotV1pa1cTxQba1+YyhZCr5Pw5bieI/ZEOP1LsVzS6vsVoQuD1jraSPV7q
DbNFFQ41Pp7Q9rD7ee0otRUA6m86qEz0VhGwRqBl0/UhoTQ4JIaDVFINKehAPHPq
oxJ42SinPYBP8BQrKuEZjv56Y7C4O4P6x/chVBYTvADXLKQJuOk/eRWoAm2CFyQl
//htidaDhC0YEmg8uvcgCXfRLxrU5+tEp/JtEXoq3LJtZvYvuFi1hQYIKGMjXSsI
4f9A1o4JlUd+gTwN03b3lU3mJV6W35S/VpkyZBf2r1w1Gis+tGs=
=pRo9
-----END PGP SIGNATURE-----
--l+goss899txtYvYf--
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |