### Summary

We have an ansible task using `wait_for` module to wait for network device carrier to be up:
```
wait_for:
  path: "/sys/class/net/{{ device }}/carrier"
  search_regex: "1"
  timeout: 60
```

This no longer works since https://github.com/ansible/ansible/commit/9d4ced1237380051334b54379ff64e45c0341a6d, because `mmap()` is now used instead of `read()`, and it isn't supported by `sysfs` in this case.

Do we really need to use `mmap()`? I imagine it might cause issues with other pseudofilesystems too.

In the meantime, we use a workaround: use grep in a loop instead
```
command:
  cmd: "grep 1 /sys/class/net/{{ device }}/carrier"
timeout: 1
retries: 60
register: carrier
until: carrier is successful
```

### Issue Type

Bug Report

### Component Name

wait_for

### Ansible Version

```console
$ ansible --version
ansible [core 2.13.7]
  config file = None
  configured module search path = ['/Users/rob.muir/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/rob.muir/workspace/trash/build/.env/lib/python3.10/site-packages/ansible
  ansible collection location = /Users/rob.muir/.ansible/collections:/usr/share/ansible/collections
  executable location = /Users/rob.muir/workspace/trash/build/.env/bin/ansible
  python version = 3.10.7 (main, Sep 15 2022, 01:50:27) [Clang 12.0.0 (clang-1200.0.32.29)]
  jinja version = 3.0.3
  libyaml = False
```


### Configuration

```console
# if using a version older than ansible-core 2.12 you should omit the '-t all'
$ ansible-config dump --only-changed -t all
```


### OS / Environment

Mac OS controller, Centos Stream 9 target

### Steps to Reproduce

<!--- Paste example playbooks or commands between quotes below -->
```
# set device to say, eth0 or whatever is on your computer
wait_for:
  path: "/sys/class/net/{{ device }}/carrier"
  search_regex: "1"
  timeout: 60
```


### Expected Results

Expect wait_for to still work with files in /sys

### Actual Results

```console
The wait_for will fail, only with recent ansible versions, due to the use of mmap()
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
host: '{{ (ansible_ssh_host|default(ansible_host))|default(inventory_hostname) }}'
    search_regex: OpenSSH
    delay: 10
  connection: local
# Same as above but you normally have ansible_connection set in inventory, which overrides 'connection'
- name: Wait 300 seconds for port 22 to become open and contain "OpenSSH"
  ansible.builtin.wait_for:
    port: 22
    host: '{{ (ansible_ssh_host|default(ansible_host))|default(inventory_hostname) }}'
    search_regex: OpenSSH
    delay: 10
  vars:
    ansible_connection: local
'''
RETURN = r'''
elapsed:
  description: The number of seconds that elapsed while waiting
  returned: always
  type: int
  sample: 23
match_groups:
  description: Tuple containing all the subgroups of the match as returned by U(https://docs.python.org/3/library/re.html#re.MatchObject.groups)
  returned: always
  type: list
  sample: ['match 1', 'match 2']
match_groupdict:
  description: Dictionary containing all the named subgroups of the match, keyed by the subgroup name,
    as returned by U(https://docs.python.org/3/library/re.html#re.MatchObject.groupdict)
  returned: always
  type: dict